Goood morning, welcome to JustAnswer!. This is Ed.
What you're watching when the tach jumps up and down is torque converter lock and release if the RPM engine speed change is more in the 250-300 RPM range. Torque converter lock is used for the purpose of gaining efficiency from an automatic transmission that would rival a manual unit by forming a 1:1 mechanical connection between the engine and the transmission while driving at higher speeds. Retention of lock is mostly dependent upon the driver's throttle input .... or rather, the electronic signal input from the throttle position sensor.
TPS (as we call it) is a potentiometer connected to the actual throttle shaft of your throttle body, which is the carburetor-looking thing on the top-middle of the engine. Its job is to monitor throttle movement through its entire range from closed (lift-throttle) to wide open and everything in between. Besides a major part in idle control and overall driveability with the fuel system, the transmission controller needs to know what's going on as well for the purposes of shift point scheduling and torque converter lock.
It would seem that once you're up to speed, the torque converter could just be locked and be done with it and that would simplify things, but if you were to do that, a chance exists for slipping the rear wheels on icy roads during a sudden lift-throttle event. The extra slippage between engine and transmission that happens when lockup is aborted softens the transition of reverse torque to the drive wheels, preventing a skid.
And if you're pulling uphill, dropping lockup out as you go deeper into the throttle allows the engine to flare a bit and produce a bit more torque through the converter's torque multiplication ability, helping you over the hump.
For the truck to be responsive while out on the road, the decision to lock or unlock has to be made quickly, so the trans controller is looking for a "trend" in throttle action that will start it on an unlock strategy at the first sign of a change in throttle. Therefore, a TPS with questionable output signal quality may simulate a change of throttle position while driving at a steady speed, producing that irritating up-down-up you see in tachometer readings.
I'd replace the TPS for the problem you've got if I could produce as little as 0.04 volt of variance in its output signal without throttle movement. Tapping lightly on the TPS body may even cause a rise in idle speed, since it takes but 0.06v of TPS signal increase to send the fuel system from an idle to an acceleration program. Torque converter lock happens at a considerably higher throttle angle than at idle, so it wouldn't possible to use this method to sort out a TPS with a bad mid-section... you'd need a scan tool or at least a digital voltmeter. I'm confident enough that this is your problem to advise you to just cut to the chase and replace the sensor unless you have a high-end scan tool at the ready, because it really isn't a handy repair process otherwise.
You'll find your TPS to be mounted on the driver's side of the throttle body, at the base of the unit, right atop the actual throttle shaft. It's the only 3-wire sensor in the area, so you can't miss it (the IAC-idle motor is either a 2 or 4-wire unit).