The TPS sensor has two switches in it. Only one is really used as it is only adjustable for the one direction. The idle part of the switch tells the ECU when the throttle plate is closed the other switch is for wide open throttle but it really only indicates when the engine is near WOT. It would be odd for it to suddenly become loose and bind up the throttle plate as it has two screws holding it down.
A TPS that is not working wouldn’t have any effect on idle speed, it basically tells the ECU the throttle is closed and when the engine is above 1500 rpm, the ECU shuts off the fuel injectors, if the throttle plate is still closed below that rpm as indicated at the switch, it brings the injectors back online. If the switch mechanically failed internally (unlikely but anything is possible) it could hold the throttle open but unlikely. Removing it if the throttle is being held open without any cable attached to it would answer that question. Either way with the engine off, you should hear the internal switch clicking as you open and close the throttle.
The idle adjustment screw can allow unmetered air to sneak past its threads and what is likely a very hard, crusty O ring. The seat and the tip of the screw are also likely covered with oil deposits from blowby coming into the intake and should be removed and cleaned. The O ring of course needs to be replaced.
There are other areas where you could have an air leak, two of which could be providing metered air. If you have AC, there is a electro bypass valve that allows additional metered air into the intake intended to raise the idle when the engine is under AC load. Without a load it could keep the unloaded engine revving higher but it is unlikely that it would hold it at 4K. The other is also designed to provide more metered air when the engine is cold, the auxiliary air valve, which has a bimetallic spring inside with a heating element that turns a disk to close off an air opening. The air opening provides metered air and raises the idle. As the heating element runs it closes off the opening and reduces the bypass air, it will close completely. Even if the unit doesn’t receive electricity, due to its position near the head, the engine’s heat will cause the bimetallic spring to close the opening.
There are a variety of hoses from the bypasses covered above that could be leaking air into the system but being unmetered air the engine would lean out and likely wouldn’t be able to run at much more than a high idle. The main hose between the air flow meter could be cracked but if so the engine wouldn’t respond properly to the throttle being opened as the AFM wouldn’t ‘see’ that air. The AFM flap could be being help open due to warpage, backfire damage or something being lodged in the opening but that would tend to cause it to be horribly rich and again likely wouldn’t run properly.
With the throttle cable disconnected at the valve cover to the pedal, the throttle plate should be closed. If it isn’t then you need to find what is holding it open. Disconnect the cable from the throttle plate itself, looking into the opening after removing the main hose to see if something is lodged between the throat and the plate and possibly by removing the TPS.
My vote is for something holding the throttle open: the cable to the accelerator pedal, the crank arm across the valve cover that transfers the motion to the second cable or something at the throttle plate mechanism or in the throat of the throttle plate jamming it open.