Change bounce direction laser spike trap?

I got this script from laser spike trap, when I touch it, it bounces me back.

Can I change the direction of the bounce to up down left right? Instead of just forward/back.
If I touch the object from bellow or up, it still bounces me forward. Along, x and y coordinates. Is it possible to change direction to include y coordinates?

Or is there another script which can do that?

Thanks for help.