Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.
Switches and variables should work effectively. Each time it's moved in a certain direction, change a variable. When the variables line up with a conditional branch, set the graphic to none and turn on a switch.
Hm . . . using the same thread for two questions. Very conservative. Anyway, I'll try and explain this.
First of all, I'm assuming you're using VX since you haven't specified. I'm not sure how this would translate into XP, or even if it would.
Make an event that starts the timer. Then, use a conditional branch on whether a button is being pressed or not. In the else, you'd make another conditional branch that concerns the timer being over that would cancel the event. If the button is pressed, stop the timer or reset it to continue in a series. I think that should work. I haven't tried it because I'm supposed to be in bed now, but it will give you a place to start.