So when the engine stalls, do the dash lights stay on, are the CEL(check engine light) and the battery light on after engine stalls?
So not a total power failure(bad ignition switch).
If CEL is still working then computer has power, EEC relay is OK.
CEL should come on each time key is turned on then go off after engine starts.
If CEL isn't working, hasn't been working, then you will need to get the codes from the computer, read here how to do that:
http://www.therangerstation.com/tech_library/OBD_I.shtml
If you get a spray can of Quick Start(ether) then the next time engine shuts down and won't restart, pull off power brake hose or PCV hose from intake and spray some into the intake, then replace hose and try to start, if it fires up then dies fuel is the problem, if it doesn't fire up then spark is the problem.
After it stalls when you turn the key off and then back on can you hear the Fuel pump run for 2 seconds?
If possible try to listen for that, turn key off and on as many times as needed, won't hurt anything.
Fuel pump can only run for 2 seconds each time, safety feature, but it is quite loud.
If you don't hear the fuel pump then that is why engine is stalling, fuel injection isn't like a carb running out of fuel, when pump goes off engine stalls out, no chugging or other signs, it's like hitting an OFF switch.
Fuel pumps do heat up, that is normal, fuel in the tank cools them off, do you notice time before stalling out is longer or shorter depending on fuel level in the tank?
Could be fuel pump is on it's last legs, and shutting off when it gets warm.
Fuel Pump relay could also be at fault, it is in the engine fuse box, FP relay, pull it out, check for corrosion in the tabs.
Key off
Use a volt meter to test for 12v in each slot in the FP relays base, one should have 12volts, that voltage is from the FP Fuse, 30amp.
Now turn the key on
test slots again, there should now be another slot with 12volts, not 5volts or 9volts, it needs same voltage as previous slot had, battery voltage.
If voltage tests OK then replace FP relay, they are about $5, it is a standard automotive relay, nothing special.
Only sensor that can shut the engine down is the CKP(crank position) sensor, it is on the front of the engine down at the crank pulley, about 10:00 position.
These rarely fail, and when they do they don't usually come back on after a few hours, so long shot, and if it did fail there would be a code saying no CKP pulse.
But wiring can be an issue, which could be effected by engine heat.
CKP sensor is connected to the EDIS-6 module, this module runs the spark system.
On my '94 4.0l it is located in front of the battery on the FRONT side of the rad support, have to get under front bumper and look up to see it.
These do run warm, and while I have never run across an EDIS module that was heat sensitive it could be possible, or may be wiring/connector has some corrosion.
If possible carry an old spark plug with you and check for spark after engine shuts down and won't restart
It is not uncommon for a coil to become heat sensitive, but it would be unusual for all 3 coils in the coil pack to do so.
1 wire in the coil pack should show 12volts(battery voltage) when key is on, test that it is full voltage.