Keep in mind a code 24 can be caused by a bad AFM electronics module OR the wiring circuit. Look in the TRSM EFI section on how to test the AFM module. Trace the wires from the AFM...they run acroos the top of the motor behind the cam gear backing plate. This is a pretty hot area...the wire insulation gets brittle and can crack. Do not clean the AFM with carb or brake cleaner...that will trash the module!
The code 52 is also likely the wiring...Shaeff used to sell a re-wire kit that will fix it. PM him.
If you use any aftermarket hose, make sure it's rated for coolant. Good to hear that is all it was. You might want to get your rad checked for blockage.
If you want to flush the system, take the thermostat out, open the rad drain plug, and run water through with a hose while the car is running. Keep the water level close to the top of the rad. When it runs clear, cut the motor off and let the water drain. There is also a block drain plug on the pass side below the manifold.
Put the thermostat back in and fill with 50/50 coolant...do not use Dex-Cool. Either Toyota Red or standard Green coolant. Might as well replace the thermostat since you removed it to flush...get a new gasket for it too.
After all this, a pressure test on the coolant system might be a good idea. This is a bit of a trouble area for this car...you want to know if there are any additional leaks