What about something like this (untested):
dim hitsprites[0] as integer
i=getSpriteHit(screenToWorldX(getPointerX()),screenToWorldY(getPointerY()))
while i>0
c=c+1
dim hitsprites[c] as integer
setSpritePositionByOffset(i,getSpriteXbyOffset(i)+1000,getSpriteYbyOffset(i))
i=getSpriteHit(screenToWorldX(getPointerX()),screenToWorldY(getPointerY()))
hitsprites[c] = i
endwhile
LASTHIT = hitsprites[c]
for a=1 to c
i=hitsprites[a]
setSpritePositionByOffset(i,getSpriteXbyOffset(i)-1000,getSpriteYbyOffset(i))
next
dim hitsprites[0] as integer
Edit: Just to explain, it goes through each hit sprite, moves it to the side then moves them all back again afterwards saving the last hit as "LASTHIT"