I would do this by having a hidden sprite at the bottom of the screen that the ball constantly tries to move towards, and a set of sensors around the ball so that when a wall is moved into it by rotation, or it moves into a wall as it falls, the ball moves away from the wall.
Offline
Have a look at the hidden sprite in my complex jumping demo. its a question of detecting when a wall is touched, and moving away from it.
http://scratch.mit.edu/projects/Mayhem/26609
Offline