What happens is your model plays until the last frame, then continues to play the last frame over and over. There are two things you can do:
1)
do
if keystate(200)=1
loop object 1
else
stop object 1
endif
loop
What that is saying is when the upkey is being pushed, loop the object. But if it is not being pushed, stop the object from playing.
2)
do
if upkey()=1 then play object 1,22,36
frame=object frame(1)
if frame=total object frames(1) then set object frame 1,0
loop
What that does is it just plays the object normally, then checks to see if the animation is at the last frame. If it is, then it it sets the frames back to 0.
Good luck!
The only way to prevent all lag in a game is not to make the game.