Why does engine cut off after idling for awhile?

Very common: The coil gets hot and shorts out, especially if mounted horizontally. They are not expensive. I'd get a new one and make sure it is mounted vertically.