Once you've decided how you want to sense that the sprite is touching the top or bottom of the stage (using Y-position of the sprite or sprite sensing or maybe the If Touching Edge sensor) then just set the direction of the sprite using:
Point in direction (90 + (90 - Direction))
Offline
I've uploaded a project. Does this fix your problem?
http://scratch.mit.edu/projects/TeleHelp/1179245
Offline