Likely several things here but with things getting hot and not working and then working again points to a thermal problem. I remember 80's and 90's GM ignition control modules that would get hot, shut down and kill the spark. By the time AAA arrived, it had cooled down enough to start working again.