I am a mechanic, but on Nissans, rather than Toyotas.
on Nissans, the ECU has a basic memory and LED readout, so it can memorise intermittent faults such as airflowmeter, crank angle sensor, temperature sender etc. Reading it involves turning a switch on the side of the ECU with a screwdriver and noting the sequence of the flashing red & green led's. The key to the codes is printed on the case of the ECU and also is in the workshop manual.
Might be worth checking if your car has this Felicity
Other things to check: Air leaks, fuel pressure, and corrosion of pins in electrical plugs on airflowmeter, temp sender, and fuel injectors.

Will
_________________________
Sussex, UK. Rio car 30Gb and Neo35