Why does engine cut off after idling for awhile?

If it just cuts out,it's usually ignition failure. Put a voltmeter on the coil the next time it happens.If you still have around 6 volts, I would replace the condenser in the dizzy, and retest. While the cap is off check it for moisture,and carbon tracking.If the problem persists,have the coil tested.
But if the voltage is AWOL, check the voltage on the input side of the ballast resistor. If voltage there is near battery voltage,jumper across the resistor and retest. If the problem goes away, replace the resistor.
But if the voltage at the input side of the resistor is awol,check the bulkhead connector.Then the Ammeter-both sides. And finally the ignition switch.
Happy hunting...................lol

Coiltest;This must be done immediately after the engine shuts off.Remove the coilwire from the cap tower and near-ground it,about 1/4 inch. Have a helper crank the engine with the key. A healthy spark means all is ok. No spark means you have an ignition problem; it could be the coil or the dizzy, or the supply voltage, or the ground...That's where the voltage checks come in.
When everything other than the coil tests out good, then it's time to check the coil.
Here's my way;
With the engine off I remove the coil neg. wire . I jumper a wire over to it ,long enough to reach the fender.I lay a long flat bastard file across the engine somewhere, so it is grounded back to the battery. I near-ground the coil tower-wire.I turn on the ignition to run. Finally I lightly drag the bared jumper wire along the file. A stream of sparks should issue from the tower-wire. You need the file to make/break the circuit. I have not been able to reliably cause the spark-stream any other way, besides pulling the dizzy and manually spinning the driveshaft, using a known-to-be-good point-set and condenser;grounding the dizzy.
I have been using the same big square Accell Supercoil,P4120889,since 1999.Seems to work for me.