The switch on the pump you refer to is the stop solenoid ..What you can do is remove switch ,careful as a small plunger and spring will fall out ..Put them somewhere safe ,refit the switch minus plunger and spring ,start and run engine ,if all ok say after 30 mins ,get a new stop solenoid ..With internals removed you will have to stall it to stop the engine ....Failing that the fuel injection pump may be at fault as in it can't maintain pressure..As it sounds as though you have a rotary pump ..If you're mechanic isn't comfortable removing the pump as it is timed to the engine ,then take vehicle to local fuel injection /bosch specialist and they can check the pump out
Will add i have never known the stop solenoid kick in itself after the engine is running then let the engine restart ,so make sure wiring is ok
norb
April 2012