Also, if the walls aren't all perpendicular to each other, there's still a fairly easy way to determine some rebound angle "C" given the angle of the wall "A" and the angle of the ball's motion "B".
C = 2A - B
It works fine whether the angle is measured in degrees or radians, positive or negative, and in any range (ie -630 instead of 90 degrees). However, it's also possible and easy for it to return values outside of the normal ranges (such as -630 instead of 90), so you could always do something like Mod(Angle,360) if you want to keep it within the normal range.