So it could be either of the two. But a leaking intake gasket wouldn't really cause a problem sporadically, like when its hot right? It would cause a vacuum leak all the time which would always make for poor driveability or idle. This problem is only when the car is hot, which leads me to believe the EGR could be at fault.