It does sound like thermal failure of the crank sensor--before you pull and replace it, is there no spark after it first shuts down?
Try unplugging and plugging the crank sensor back in a few times.
The coil also likes thermal failures.
X2 what was said here.
When I had the stalling, then start no start issues the first time, it was my crank position sensor.
Mines an 88...4.0...auto...4x4, verified it was my cps with a DVM. Replaced it.
Had no problems for a while, then the same symtoms returned. They appeared to be the same anyways.
Took it to my buddys shop and ran every test that we could (noid, spark, fuel pressure, voltage) but it would not act up long enough to pinpoint the real problem.
We did this for two days with it being intermittant that way. The second day I was driving it home from his shop....I didn't make it home, and it's just a 4 mile drive.
In my case, it finally got to where it would not start at all....then it was an easy find, narrowed down where the problem was.....the Ignition control module. Replaced it with a used one from a 90 model.... been going ever since.
What made it had for me was before we could find out where the breakdown was it would straighten itself out.
Beings mine is 22 years old...anything could have been the culprit even a simple thing as a wiring or connection problem.
Keep after it...you will sooner or later find it.
As a side note....invest in a cheap inline ignition spark checker. You can find out where you are loosing spark...from coil to the dist or from the dist to the plugs.