Whatever the switch, I think our short was caused by that wire poking out to the side.

I know not what the switch is for. The wire - if it's going to fit into those push-in ports, can't be larger than #12 (very old switch) or #14 (modern models). Either way, that's too small for a 30-A water heater ... and the disconnect for the heater should open BOTH hot wires.

Use of a cord & plug -even appropriate selected ones- on a water heater contradicts UL's "listing and labeling." UL has not evaluated the wiring compartment size, or the strain relief connector, for use with either flexible cord, or the flat cords used for 30-A clothes dryers.

UL does list some 125-v, 5-gallon water heaters that come from the factory with a cord and plug.

That's the official word. I disagree with it. My personal home's water heater, furnace, and dishwasher are all connected via cords & plugs.