Hey there. Your code is not working because the game keep updating the size of your sprite, and every time the game resizes your sprite it put it back to its original position.
At the group "Layer" you have 3 events that happens depending on the value on the UILayer variable. Along with each of this events add another condition system > trigger once while true.
It'll solve your problem