@john_john
You should checkout my source code for my Balancing robot:
https://github.com/TKJElectronics/BalancingRobotArduino@susheel
1. Do you mean there is a problem when the angle change from 0 to 360? This can easily be fixed by making the angle 180 when the robot is upright.
2. I don't do anything to prevent that, but I have seen other people do that, but I really don't think it's necessary.
3. Try to make the robot as symmetric as possible, so one of the sides doesn't weigh more than the other - my robot can almost balance by itself. Also remember to put some weight at the top in order to raise the center of gravity. Remember that the better the mechanical structure is the better the end result will be!