The switch takes the ignition to ground. May have corrosion in the switch. Sometimes it can be as simple as turning it on and off (not running) several times in a row.
also see if the symptoms are the same using the stop lanyard. when the key is switched off it not only grounds the ign but it also stops the fuel pump. if the switch is failing it may give those symptoms.