Re: bad idel
If the flywheel nut is under-torqued, or if someone misguidedly applies lube to the crank taper, the shear key can in fact be sharing the job of holding the flywheel to the crank. This will usually result in a sheared key. I've seen a couple of motors where the key was sheared and you could easily turn the flywheel without the crank turning at all.
Anyways, here's another possibility that doesn't involve a sheared key. Maybe the inner ring of magnets on the flywheel, the magnets that control the timing and firing of the spark plugs, has loosened up and shifted out of position. They can actually shift back and forth so that at times, when they're in the normal position, the motor runs fine, but when they shift out of the position the timing is all messed up. To test, remove the flywheel, grab the inner ring of magnets, and firmly twist back and forth. Any movement and you have problems. I don't believe there's any way to "re-glue" them as can be done with the outer ring of magnets.