Could be the loping is due to the ECU cutting fuel to the injectors from time to time due the high idle speed. The unplugging/plugging in the TPS would point to this, as with TPS unplugged, there is no idle indication as there is when it is plugged in. Not sure why the idle is set so high.

When I first got my 22RE running after installing a new cam, it was a somewhat loping and fast idle. Spent hours looking at things and one day a buddy came over as I was working on it. He asked me why I was missing a bolt on the back of the EGR where it attaches to the intake. I guess with the rough initial idle that bolt had backed itself out and was now causing the sort of loping idle. But in the mean time, I had been going through every sensor and device with the assumption it was bad and then I proved to myself that the device was working properly.