It is only to your advantage to write neater source code.
It helps to identify bugs easier than messy lines of code.
Heres a sample of yours cleaned up and you will see if endif errors alot more clearly by deploying a tab to cascade your code in/endifs.
rem ------------------------------------------------------------------
rem Program name :
rem Author :
rem Version :
rem Created :
rem Copyright :
rem
rem Notes:
rem ------------------------------------------------------------------
rem --------------------------------
rem SETUP
rem --------------------------------
cls : sync on : sync rate 60
hide mouse
ink rgb(255,255,255),1
set text size 13
set text font "verdana"
set text opaque
center text screen width()/2,screen height()/2,"loading.."
rem --------------------------------
rem DEFINE GAME VARIABLES
rem --------------------------------
y=60
bx=320
by=240
bxtest=8
bytest=0
my=60
up=0
rem --------------------------------
rem LOAD MEDIA
rem --------------------------------
rem load sound effects
load sound "fastping3.wav",1
load sound "oppfastping3.wav",2
REM MAKE SURE THE FILENAMES ARE NEATER THAN THIS
REM IT HELPS TO RENAME THEM WITHOUT SPACES
rem load music
load music "blade 2 blade.mid",1
load music "At The Gates.mid",2
load music "Explorocean.mid",3
play music 1
load bitmap "introscreen.bmp",4
load bitmap "outroscreen.bmp",5
rem --------------------------------
rem INTRODUCTION
rem maybe make this a gosub or function
rem --------------------------------
rem outro
get image 5,0,0,639,479
sprite 5,0,0,5
hide sprite 5
rem intro
get image 4,0,0,639,479
sprite 4,0,0,4
wait key
delete sprite 4
delete bitmap 4
cls
rem get player input
set cursor 300,0
input "NAME: ",name$
cls
rem opponent
create bitmap 3,50,150
set current bitmap 3
ink RGB(48,212,40),0
box 1,1,49,149
get image 3,1,1,49,149
rem ball
create bitmap 2,25,25
set current bitmap 2
ink RGB(232,44,40),0
box 1,1,24,24
get image 2,1,1,24,24
rem player
create bitmap 1,50,150
set current bitmap 1
ink RGB(48,212,40),0
box 1,1,49,149
get image 1,1,1,49,149
rem position player/opponenet
sprite 1,10,y,1
sprite 3,580,my,3
sprite 2,bx,by,2
rem --------------------------------
rem PRE MAIN
rem --------------------------------
disable escapekey
rem --------------------------------
rem START MAIN LOOP
rem --------------------------------
while escapekey()=0
rem handle music tracks
if music playing(1)=0 then play music 2
if music playing(2)=0 then play music 3
if music playing(3)=0 then play music 1
gosub MoveOpponent
gosub MovePlayer
gosub MoveBall
rem --------------------------------
rem Head up Display
rem --------------------------------
text 10,10,"myGame"
text 10,30,name$
DisplayFPS()
rem --------------------------------
rem SYNC MAIN LOOP
rem --------------------------------
sync
rem --------------------------------
rem END MAIN LOOP
rem --------------------------------
endwhile
rem --------------------------------
rem CLEAN UP
rem --------------------------------
show sprite 5
wait key
end
rem --------------------------------
rem GOSUBS
rem --------------------------------
rem --------------------------------
rem MOVE OPPONENT
rem --------------------------------
MoveOpponent:
if my>by
if bx>525
if my-4<0 then my=5
my=my-4
up=2
sprite 3,580,my,3
EndIf
EndIf
if my<by
if bx>525
if my+4>320 then my=315
my=my+4
sprite 3,580,my,3
up=1
EndIf
EndIf
return
rem --------------------------------
rem MOVE PLAYER GOSUB
rem --------------------------------
MovePlayer:
if upkey()=1
if y-7<0 then y=8
y=y-7
sprite 1,10,y,1
EndIf
if downkey()=1
if y+7>330 then y=322
y=y+7
sprite 1,10,y,1
EndIf
return
rem --------------------------------
rem MOVEBALL
rem --------------------------------
MoveBall:
sprite 2,bx,by,2
if bx>620 then exit
if bx<2 then exit
if by<2 then bytest=8
if by>460 then bytest=-8
if sprite hit(2,1)=1 and upkey()=1
play sound 1
bxtest=8
bytest=-8
EndIf
if sprite hit(1,2)=1 and downkey()= 1
play sound 1
bxtest=8
bytest=8
EndIf
if sprite collision(1,2)=1
if upkey()=0 and downkey()=0
play sound 1
bxtest=8
bytest=0
EndIf
EndIf
if sprite hit(2,3)=1 and up=1
play sound 2
bxtest=-8
bytest=-8
EndIf
if sprite hit(3,2)=1 and up=2
play sound 2
bxtest=-8
bytest=8
EndIf
if sprite hit(3,2) and up=0
play sound 2
bxtest=-8
bytest=0
EndIf
bx=bx+bxtest
by=by+bytest
Return
rem --------------------------------
rem FUNCTIONS
rem --------------------------------
DisplayFPS()
text screen width()/2-30,30,STR$(Screen fps())
endfunction