I had the same problem with a craftsman a couple weeks ago. I opened it up and removed the engine covers to find a mouse nest. I examined the wiring to the high voltage transformer and the spark plug wire and found that a mouse had nibbled the rubber insulation. A few turns of electricians tape fixed things.
Is the engine Briggs and Stratton, or Kohler etc? what year ?
I know Briggs frequently uses a ground wire to shut engine off, pulling it will eliminate wiring problems.