Its for X/Y of the background tile. 0 for coordinates as the BG coordinates(in character units) Or 1 for screen coordinates as screen coordinates(in pixel units)
Here you go :) In code it would look like this
@loop
ID=BGGET(0,X,Y,1)
IF ID==2 THEN X=OLD_X:Y=OLD_Y
SPOFS 0,X,Y
OLD_X=X:OLD_Y=Y
GOTO @LOOP
Change the number in the if statement to what BG tile you want it to work with :)