what would cause a breaker box enclosure to be electrified?
First I would like to say, thank god you weren't seriously injured. Second this is a very serious situation. The reason someone is shocked when touching a metal enclosure is because you are grounded and the enclosure is not.

You're neutrals and grounds are tied together at the first means of disconnect. It will be bonded at the main breaker and if there is no separate main it will be done at the Panel's main breaker. Check to make sure the bonding screw is properly installed and the grounding bus is bonded with the neutral bus. Then check to see if your grounding electrode conductor actually runs to a proper grounding electrode. Check for corrosion and loose connections. If everything is properly done, if you have a problem you should get a trip on the breaker having a problem.

If you're not getting a trip then you probably have a piece of 240V equipment that is missing a phase, the neutral, or the ground is not connected properly and you are getting one phase trying to seek a path back to the Panel and the breaker. I noticed that you said you were trying to debug an appliance. I would start there.

Under no circumstances should you be trying to troubleshoot this problem under power. Disconnect all power and troubleshoot with a continuity tester or an ohmmeter. If all of this seems to technical I would advise you seek professional help.