Looks like you are getting close, hope the EGR valve didn't set you back too much, but at least you have ruled it out as the issue and what you determined with the red wire is suggesting that the problem indeed lies in the EGR circuit.
Is it RED or PINK, my Haynes wiring diagram shows the following wires on the EGR valve for your engine/year (same as my 2001 3.1), no RED wire noted:
Pink - EGR Valve 12VDC solenoid excitation (comes from main 12V PCM IGN 15A fuse in the underhood fuse panel near the battery - with this harness wire disconnected at the EGR valve it should show +12VDC to ground (battery negative terminal) with the ignition switch in BULB TEST or START. I think by BULB TEST they mean the position you turn the key to just before going to START, basically where the switch sits once the car is running.
Gray (1 of 2) - EGR solenoid control signal - comes out of the PCM module. Not sure exactly what you should see there, by the circuit it is the other end of a solenoid coil that is powered by the pink wire, and returns the 12 Volts DC from the pink wire to ground through the PCM. The amount of current though the solenoid changes the position of the EGR valve stem to whats called for by the PCM based on various other signal inputs to the PCM, including the stem postion feedback signal from the potentiometer.
Gray (2 of 2) - 5V Reference Voltage for EGR valve stem position sensor potentiometer. This is the one that should have the +5V to ground on it that also feeds the other stuff like the fuel gauge. The pot is mechanically connected to the EGR valve and tells the PCM the actual position of the valve at any point in time. The solenoid and the pot are part of a feedback control system to put the EGR valve where it has to be. With the EGR valve unplugged you should see 5V there with the igniton switch in BULB TEST (i.e run).
Brown - EGR position signal - comes of the wiper of the position sensor potentiometer that has 5V reference on one end (the 2nd gray wire), and ground (the black wire discussed below). The voltage on this wire varies porpotrionally with the EGR positon between somewhere between 5V an 0 volts, proportional to valve position with the igntion switch in BULB TEST (run).
Black - EGR positon sensor pot ground return- tied to car ground at the PCM.
I"m wondering if whomever did the splices you found crossed the two gray wires up! That would likely really screw up the 5V reference signal, because it would be connected to the 12V from the battery through the valve positioning solenoid coil. You can tell which gray wire should be the one for the EGR solenoid and which is for the 5V excitation of the EGR position sensor potetiometer as follows: (BTW, shame on the GM engineer/designer making two wires on completely different circuits the same color on a 5 wire connector!) :
With the ignition shut off, and the connector installed on the EGR valve, after noting gray wire going into the harness is connected to which lead off the connector, undo the splices on the gray wires or otherwise cut them off from the harness so you can "look into" the EGR valve with an ohmmeter on the pieces of gray wire coming off the connector. Mark the wires so you know what your gray wore connections were going int this test. The connecter side gray wire, when not conneted to the harness wiring that goes to the solenoid will have a very low resistance with the plug connected to the EGR valve, and an open circuit with the connector disconnected from the EGR valve.
Now, with the two gray leads from the connecter still disconnected from the harness gray wires, turn the ignition on (but do not start the car). The harness lead that carries the 5V reference signal should show +5 V to ground. I am not sure what the harness side gray wire for the solenoid valve control should be, but it most likely will be low, since it appears to be a return to ground for the 12V from the pink wire. The piece of the gray wire on the connector side, with the key on, and the EGR valve connected, that is the gray wire for the solenoid return, should show +12V to ground (its getting it through the pink wire, with no current flow, there is no voltage drop through the coil.
At this point you should now know which gray wire on the harness side is the 5V reference, and which gray wire on the EGR connector side is the solenoid return wire. These two gray wires do not/should not be connected to each other. The gray harness side wire with the 5 V reference signal goes to the other gray connecter side wire.
You following all this? This is what I would do if it were my car with your issues, but if you follow my advice, don't come after me if something gets fried! And if it turns out that the gray wires were in fact hooked up right, and the only way you can clear the problem at this point is disconnect the RED/pink wire, I'm not any further alnog than you at this point.....not sure how driveablility might be affected. Now to go figure out my cars issue...going to do some troubleshooting on it before the snow flies! The wiring on the TPS connector looks kind of shaky for starters....