You could shoot in 4 directions, not just 2.
Before morning caffeine, I believe you can do something like this...
In the selected direction, calculate the "effective" end point, as if this were just a huge box, with no bounces.
Basically, add get the distance to the border in your selected direction, multiply it by the amount of bounces, and add that to your endpoint.
Then just get the angle between the start point and that "effective" end point.
EDIT: You might have to add a different distance on odd/even bounces -- (absolute) distance to border in selected direction for odd bounces, (absolute) distance to border in opposite direction for even bounces.
So 5 bounces gives you an effective end point that is offset by (3*absolute_distance_to_border_in_selected_direction + 2*absolute_distance_to_border_in_opposite_direction).
EDIT 2: The previous edit wasn't quite correct -- which you can see in Nanoha's image below, but I think you're able to get a rough understanding of what you need to change in order for it to work