Is it a turbo?
Some of them have a "run on" feature to allow the turbo pressure to get down before turning off, but this only usually happens if you start the car to move it forward or something and then shut it off.
If non-turbo, then i guess it's the fuel shut off solenoid on the injector pump which is causing problems. They're not that expensive and fairly easy to change