Saturn - Fuel Issues - Car shaking like it is going to stall?

I have a 2002 Saturn SL1 with 82K miles. About a year and a half ago I experienced some stalling that usually occured between 0 & 10 miles per hour. It was in the shop a couple times and they could never diagnose it. I recently had it in for the service enginge soon light. The codes were for a fumes and engine stalling but all they could find was a fuel cap that needed to be re-seated. The following week I noticed decreased gas milage (roughly 160 miles to the tank) and now I am feeling like the engine isn’t getting enough power. The car has been shaky in the lower speeds and when going up hills. It feels like it might stall but hasn’t. The service engine soon light has flashed on and off, stayed on for one full day and then blinked off again but I am still feeling some shaking occasionally when I accelerate. I need help!

Need the exact codes, not someone’s interpretation of them. These cars have a bad history of sucking in the intake manifold gasket around the number 1 cylinder. This is easily verified by spraying something like a fuel injector cleaner or wd 40 around that intake port to see if the idle is affected.

The typical code for this problem is P0507.