Is this method of programming incorrect?
Yup. Call the keyhit function once and it resets the current keyhit value for the key you are checking against.
To do your example above you could use a select case statement or more if's
if keyhit(28) if a=0 value=true if a=1 value=false endif
Both methods will be faster (less key checking) and the code will be cleaner/ easier to change. For example if you want to change the key you use for this task you would have to go through a lot of commands replacing the vlaue. In the example above you would just have to do it once.