Have a Car Question? Ask a Mechanic Online.
There are two things that come to mind the first being a crank sensor, these are fairly comon and we do a lot of them at the shop, if it has failed with out shorting the controller can not see the engine crank and may not set any codes for it
The next thing is a wiring issue, open the hood and locate the fuel rail follow back towards the fire wall the main harness may have fallen down and be resting on the end of the fuel rail over time this will abrade into the harness causing many different issues, if it is laying on the fuel Rail open up the convoluted tubing and inspect closely the wires will only have insulation rubbed off and be grounding at times if damaged repair, and relocate the harness I normally just lift it up to the other harness on the fire wall and wire tie it in place
I Hope this helps and gets you on your way
If you need more information just let me know
If the wiring is not damaged, i would most likely replace the crank sensor, from what you are saying it seems like it shuts off when hot and runs when cold, if the sensor shorts inside when hot it can shut down the engine controller and clear it of codes so you may never see it set a code for this, these sensors are a very comon issue on the 4.0L,
if you need anything else just let me know
Sorry I took a little to get back to you, i was at work