You should correct at least two things as follows.
#1:Write variables of your sprite coordinates for second and third arguments of BGGET.
#2:Return value of BGGET is certain character number of BG tile. Every BG tile has its own character number. You can confirm it with smile tool.
I guess you should write line 128 as follows.
IF BGGET(0,X,Y,1)==(the character number) THEN...
0そうだね 未プレイ