Anyone know how to prevent the electricity from damaging power armour or the person inside the power armour? Some kind of surge protector? Bonus points if an electricity gun can recharge the batteries but not overcharge them.
Well surge protectors between segmented pieces. I.E. if there's some malfunction in the arm, stop any sort of electrical burst from traveling back up the arm to what presumably would be a servomotor, don't let malfunctions break the wearer's body kind of thing. In terms of raw current going through the metal plates, the user should definitely wear an insulated bodysuit. For areas where there may be difficulties in covering the body fully, like the head, some insulating layer between the outerwear and the inside would work best. I imagine something like how astronauts once clipped helmets on: you have your electrically insulated bodysuit that covers you completely except for your head. To ensure a completely insulated covering you'd have to connect the suit to the helmet.
The safest bet would be to have some sort of system where the user can manually reopen circuits, turn on/off the electrical current from the power source, etc. Because if something DOES go wrong the user should be able to either reactivate the suit or be able to get out of their own accord.
Finally, when you talk about protecting the armor I assume you mean protecting the powered bits? I'd like to imagine the best way would be to isolate each limb and relevant appendages as well as the chest and groin areas through surge protectors and parallel wiring or even just wiring each section entirely independently to the power source and computer.