I'm assuming that the fuel shutoff is similar to Bobcat machines, so I'm working off that idea.
The normal state of the the shutoff lever is off, it is spring loaded to return there by default, and the solenoid has a pull and a hold coil to allow operation.
What's probably happening is that the return spring is weak, or there is enough gunk built up that makes it difficult to move, or worse, something inside that's causing binding.
With the solenoid removed, you should be able to pull the lever over to the run position, release it and it should snap back to the shutoff position. The fact that is slows down and gradually stops after a bit of time indicates that something is keeping the pump shutoff lever from moving freely, and it isn't the solenoid.
Hopefully, just and old toothbrush and some solvent will free things up, or you'll see a problem with the return spring.