As Skeans said I,d check the grounds.I had my frame/engine mounts powder coated and would get intermittent spark.Once I cleaned the contact points on the frame mounts and engine I was good to go.
If they are good I would suspect the coil may be breaking down once it gets warm.Do you have another coil around to try?