The secondary TPS has nothing to do with idle, etc.
It only is used once it is indicated that traction control needs to reduce torque to a slipping wheel.
And it only is used in some special corner cases. - but it does cause the TCS and SLIP lights t come on if it is broken.
The error codes for TCS caome from the TCU in the trunk.
That error code can indicate a TCM problem, and then you look at the error code on the TCM in the dash... which for the secondary TPS us 13 (if I recollect correctly).
NONE of this affects your idle.
So you likely have other issues.
The ECU also throws error codes, but a bad idle likely does not.
You are then into the standard how to fic my idle/engine smoothness troubleshooting.
The usual subjects are the MAF, AIC, Injectors, and a few other things.
I think
www.q45.org might be the easiest place to look for the standard problems to look for.
I think there was a thread on this subject about a month ago, too.