Go to Harbor Freight and get two $10 multimeters.
Hook them to the back of the wire harness at the ECU. Set one to measure the signal from the TPS. Set the other to read the supply voltage feeding the TPS.
Set them up in a secure way so that they can't flip over, unplug themselves or slide around.
Then just drive around normally until the car dies again. When it dies again, turn on the multimeters and read the results.
You're looking for two things:
1. Does the TPS have supply voltage? What is the voltage?
2. Is there a TPS signal and does it change when you step on the gas pedal?
What is the signal voltage with your foot off the gas pedal?
What is the voltage signal with the gas pedal pressed to the floor?
There might not be anything wrong with the TPS, but you have to start trouble shooting somewhere. It could be an intermittant bad connection or a failing/confused ECU.
---------------------------------------------------------------------------------------
If you don't understand this part, just stick to using the multimeters.
If you know what you're doing, you can also use LED's with resistors hooked in series and connect them to the power supplies to vital areas ( like the fuel pump and the ignition system )
That way you can get a quick accurate check of what is turned on and what is not.
Then when the problem happens you can quickly ask and answer questions like:
Is the ECU turned on by the Key switch?
Is the fuel pump turned on?
Is the ignition system turned on?
This can work in any situation where you need to check a power source or slow digital signal, but be warned! You have to use the biggest resistor and smallest LED that you can ( that you can still see clearly )!
Power sources are more forgiving, but digital circuits are not designed to power external loads. I wouldn't draw more than 1mA from them. They might over load or malfunction if you do.