You don't need a script, just a common event. Set it as a paralell process and call it with some switch at the beginning of the game. Then put in the common event something to this effect:
Conditional Branch: Button Y is being pressed [Comment: Y is S by default and can be set in F2 of Test Play]
Conditional Branch: Player is facing down
Set Move Route: Player (Ignore if can't move)
Jump: +0, +1
Else
Conditional Branch: Player is facing up
Set Move Route: Player (Ignore if can't move)
Jump: +0, -1
Else
Conditional Branch: Player is facing left
Set Move Route: Player (Ignore if can't move)
Jump: -1, +0
Else
Set Move Route: Player (Ignore if can't move)
Jump: +1, +0
You can edit distance, just post if this doesn't work.