That might crash in DrawLoop for whatever odd reason; you shouldn't really put logic like this in the DrawLoop. You also don't want to be starting any tasks from DrawLoop nor do you want to be using wait() or yield in DrawLoop, in general. I think part of the misunderstanding here is that you're trying to work in the DrawLoop which you really shouldn't be doing.
That basic idea could work if you're insistent on using the loops though, like
let lastfocusstate = KEY_FREE;
@MainLoop{
if(GetKeyState(VK_SLOWMOVE) == KEY_PUSH || GetKeyState(VK_SLOWMOVE) == KEY_HOLD){
if(lastfocusstate == KEY_FREE){
effectthing();
lastfocusstate = KEY_HOLD;
}
}else if(GetKeyState(VK_SLOWMOVE) == KEY_PULL || GetKeyState(VK_SLOWMOVE) == KEY_FREE){
if(lastfocusstate == KEY_HOLD){
effectthing();
lastfocusstate = KEY_FREE;
}
}
}
As for the SetPosition, just do something like this
let obj = Obj_Create(OBJ_EFFECT);
ObjEffect_SetTexture(obj, thing);
ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLESTRIP);
ObjEffect_CreateVertex(obj, 4);
ObjEffect_SetVertexUV(obj, 0, 0, 0);
ObjEffect_SetVertexUV(obj, 1, 0, 32);
ObjEffect_SetVertexUV(obj, 2, 32, 0);
ObjEffect_SetVertexUV(obj, 3, 32, 32);
ObjEffect_SetVertexXY(obj, 0, -16, -16);
ObjEffect_SetVertexXY(obj, 1, -16, 16);
ObjEffect_SetVertexXY(obj, 2, 16, -16);
ObjEffect_SetVertexXY(obj, 3, 16, 16);
let spin = 0;
loop{
Obj_SetPosition(obj, GetPlayerX - 20, GetPlayerY);
ObjEffect_SetAngle(obj, 0, 0, spin);
spin += 2;
yield;
}