I'm not sure if you're coming from Petit Computer, which limited IF statements to one line, but in SmileBASIC, you can have multiple lines in an IF, like so:
IF B==8 THEN
X=X+1
LOCATE X-1,Y
PRINT " "
ENDIF
Also, rather than @LABEL ... GOTO @LABEL, I personally find it cleaner to use WHILE or REPEAT instead.
As for checking buttons, there are some things that can be improved.
First, note that there are built-in constants for the buttons like #UP, #DOWN, #A, #B, #L, and so on. So, rather than B==8, you can write B==#RIGHT, which is a lot easier to understand.
The other issue is a bit more complex. Basically:
B==#RIGHT is true when Right is the *only* button being pressed.
B AND #RIGHT is true when Right is pressed, regardless of other buttons.
It's hard to explain without getting into binary, but basically each button is a bit. AND matches the bits on one side with the bits on the other side, and creates a number with only the bits set on both.
So, when Right isn't pressed, B AND #RIGHT equals 0, because #RIGHT isn't set in B, but is set in #RIGHT.
When Right is pressed, B AND #RIGHT equals #RIGHT, because #RIGHT is set on both sides.
In other words, it'll be either 0 or #RIGHT. Any number that isn't 0 is considered true, so these come out as false or true.
It's because you've moved some stuff out of your loop. The line where you update B and the line where you print the player should be inside your loop, like in your first screenshot, or else they'll only be run once.
Also, note that ENDIF is only necessary if you split your IF into separate lines.
This doesn't need ENDIF:
IF condition THEN code
This does:
IF condition THEN
code
ENDIF
Yes, ENDIF isn't needed with your code. It's only needed if you have code like this:
Line 1> IF B==#RIGHT THEN
Line 2> PX=PX+1
Line 3> LOCATE PX-1,PY
Line 4> PRINT " "
Line 5> ENDIF
because otherwise it wouldn't know where the IF ends.
Your code is like:
Line 1> IF B==#RIGHT THEN PX=PX+1:LOCATE PX-1,PY:PRINT " "
so it doesn't need ENDIF because that form of IF ends at the end of the line.
That is a good point about VSYNC. At the moment, it looks like you have VSYNC 5 to limit the speed of the player.
That's fine, but it limits your whole game to 12 frames per second, since 60 divided by 5 is 12. For a simple game this is probably okay, but if you want to limit this to just the player, you could use a variable that counts down each frame before it allows the player to move.
Don't give up! You're very close to making a complete program! Many developers face hardships when making games. Some have even lost the entire source code to their game and had to rewrite it from scratch. And yet they've made awesome games anyway. Just keep programming your game. You'll finish it eventually!