You should be able to. Just use the "set gravity" action on your player. Set it up so when you press the z key, you set the gravity to a negative number.
You will probably need some invisible sprites to act as walls on top of the screen so your character can stop and walk on the ceiling.