This sounds a lot like the PTU/ Power Transistor Unit. Its the finned box on the front of the timing belt cover on the passenger side of the car, just behind the top rad hose. Heat gets to them and eventually they go south, cutting out until they cool off and allow the car to run fine again, until once again it heats up and kills the spark to the engine. Search the archives for the PTU and see if it fits your scenerio. Good Luck!