Why lug it down to shut down, There is a manual fuel cut off lever right on the fuel pump.
Sounds like you have figured it out, but I will add another thought for the good of the order. I had a friend who had a diesel tractor with intermittent stopping issues. It turned out top be bacterial growth in his fuel. Now he puts a fuel treatment in his tank top prevent organic growth. Sounds crazy, but something to think about.
Last year I replaced the fuel pump. OEM replacement was $500 so i went with a $20 universal, no fuel shut off.
.
Regarding fuel shutoff solenoids, many times it's the wiring that's the culprit. As everything ages wiring is one of the primary points of failure: insulation breaks down, wires start breaking etc.. Good troubleshooting practice is, as has been mentioned, to bypass the stock power wire to the solenoid. If you've got a good 12v to the solenoid then any issues are going to be with the solenoid (or something else- also quite possibly wire-related [IP wire harness]). The clicking sounds are pretty telling: there shouldn't be any unless the operator has switched the key.
I toss out the "energized" altogether. You need voltage to allow fuel to flow (with a properly functioning shutoff solenoid): if there's an instance in which dropping voltage doesn't shut off the fule supply then I suppose I'd like to hear/know of it. What I was trying to introduce here is that the wires themselves are often the culprit: folks can chase their tails around and then come back to find a broken wire which will flex "open" (dropping voltage) when operating (yet be perfectly fine when just sitting there)- wires will tend to break down at connectors or near a point where a wire harness goes from a fixed route to a flex area (wire unsupported); check resistance while messing with the wire(s), or, just completely bypass (with the fuel shutoff solenoids they tend to a simple single wire affair, so bypassing is a quick way to chop the problem in size).