Oh how I love (read as hate) this engine. Well not the engine itself but the TBI.
So it runs good cold because it's in open loop mode. While in open loop mode the engine is metering fuel only with the TPS and a default map that will not be the best in the efficiency or performance, but it will keep the engine running. Once the engine hits about 175°-180° it will pop into closed loop mode, and then will determine metering from all of the sensors in place. O2, MAP, TPS, temp, and the tach signal. If any of these sensors or signals are not getting back to the computer properly, then issues will arise. When idling the computer uses the readings from these sensors to also keep the idle speed around 650-750 when not in gear and around 800 when in gear. It does this by opening and closing a servo motor in the idle air control valve. If this valve will not close or open properly the engine can surge, or hunt for the correct idle. This characteristic will go away as soon as you open the throttle just a little bit. Though during this hunt phase the engine can stall out easy as it may be in a too rich or too lean condition when the throttle opens up and this could tip it over the edge of being able to run. Also the reason you have to wait to start back up, is you need the engine to cool enough to put itself back into open loop mode.
Now here is the tricky part. Finding out what's the cause. First off there should be a vacuum hose from the throttle body to the MAP sensor. This MUST be in good condition and not leaking, and no fluid inside. Exhaust leaks and bad (ie slow switching) O2 sensors can be an issue as well. TPS with a bad section can cause the engine to drop out when your throttle input goes into the bad section but it shouldn't prevent restart. A scan tool that can read live data, and a spec sheet of what the readings should be would be the best help.
If you get the truck into the closed loop mode and it won't start, try unplugging the MAP sensor and see if it starts. This should force the computer into open loop mode, and allow it to start. If it does start at this point, then you know the issue is with sensors. If it doesn't start then the issue is ignition or fuel.