If I understand how this works correctly... The engine is designed such that exhaust gas which the EGR system re-introduces will cool the temperature inside your cylinders as combustion happens (this is to create less NOx). The EGR valve regulates the amount of exhaust re-introduced into the engine. Sounds like your EGR valve is stuck open (introducing the max amount of cooling exhaust gas) most of the time, with occasional intermittent times where it works (and the code goes away). Since you have too much exhaust gas most of the time, it will run poorly and probably have poor mileage since you'll have more unburned fuel. Once it warms up/jiggles enough/you get lucky enough for it to get un-stuck, the engine would run more smoothly since the temps in the cylinders are what they're tuned to.