EGR Code 31...Where do I start?

So how does the TPS go bad?

The TPS sensor is a variable resistor like the volume control on most cheap radios.
We have all heard them make scratchy noises as you turn them up or down.
The carbon element can wear and cause a drop out spot in the output voltage.
This confuses the computer because it expects to see a steady TPS voltage
increase as the Throttle opens up.

Wire colors & functions:
Orange/white = 5 volt VREF from the computer
Dark Green/lt green = TPS output to computer
Black/white = Signal ground from computer

TPS troubleshooting steps:
1.) Use the Orange/white & Black white wires to verify the TPS has
the correct 5 volts source from the computer.
2.) Use the Dark Green/lt green & Black/white wires to set the
TPS base voltage. Try this... Currently there is some dispute about setting
it at .99 volts being worth the effort, but anything less is probably OK.
All you need is less than 1.0 volt at idle and more than 4.25 at Wide
Open Throttle (WOT). You'll need a voltmeter with a 1 or 3 volt low
scale to do the job.
3.) Use an analog voltmeter to check the voltage on
the Dark Green/lt green & Black/white wires to make sure that it
increases smoothly and doesn’t drop out or increase suddenly.
 
Alright, I didnt know if it would just break or gradually fail. I tried the varying the TPS while reading the ohms before but nothing showed up. It wont hurt to try again.

Whenever you say adjust the voltage through the green wire is this with the car idling? I have been making all my adjustments with the car off.
 
I tried the varying the TPS while reading the ohms before but nothing showed up. It wont hurt to try again.

I think you mispoke (or I'm too tired to even post) but you want to check the TPS signal return using the volts scale on your meter. For a voltage check, you'd have the key-on, engine off (you can do it with the car running too, but there's really no need to do so).

I prefer an analog/chronograph-style meter because you can see the needle sweep all nice and pretty. A DMM is harder to follow and you have to go really slow. You'd choose the scale at or above 5 volts. Some meters auto-range to make it easier.

Good luck.