I had a similar issue with my '04 V6 not long ago. Those are both codes I was getting intermittantly (along with several other throttle codes) for a few months before my battle with my P0108 code in another thread (
http://www.lincolnvscadillac.com/showthread.php?t=52717). That ended up being a bad EGR module.
Before changing the EGR module, I had continued driving the car and recording all codes that came up. One was an odd code that led me to a TSB stating the Throttle Position Senor should be changed and the PCM flashed. I took it to the dealership, it cost me just under $200. The TPS housing was warped and deformed from heat or high voltage or whatever. I had drove mine for a month with the random "fail safe mode" issue before getting the oddball code that pointed me in the right direction.
TSB info here >>
http://bradbarnett.net/mustangs/galaxie/tsb/tsb05_14_04wrench.pdf
Bad part in my situation was that even after having the TPS changed and PCM reprogrammed, I was still getting the fail safe mode intermittantly. That's when the digging went deeper and also found the EGR module.
I would say get the instructions on the TPS removal and installation and pull the TPS off and visually inspect it for the same deformed housing. If you have the deformation of the housing, take it to the dealership with the above TSB article and also have them fully inspect the EGR module for proper operation and ask them to test the 5V circuit at the ERG module. If they say it needs changed or the voltage is a little high (+/- 0.2V was the acceptable range of variance from 5.0V), I'd recommend purchasing the ERG module from rockauto.com (price from them for the stock Motorcraft part was about $85 as compared to the local dealer price of $150.84). Two 10mm bolts and a hefty crescent wrench and you can do it yourself in 5 minutes. It mounts right at the front of the upper intake on the passenger side. The TPS is right on the throttlebody and held by a couple screws.
Our cars are virtually identical other than the model year. Mileage fits the scenario too. Sounds OH so familiar to me,, hope you get it whipped.
Good luck. Let us know where it goes.