hi, my diesel focus did a similar thing, used to rev up after you had been running for a while and had stopped at traffic lights or a roundabout. it followed this some weeks later by deciding to sit a idle speed and not obey the throttle at all,same situation, after running and stopped for lights etc. so you had to switch off and back on and it would be o.k. again. I took it to a ford garage, they used the computer reading device and told me that it was the exhaust sensor, but as it was integral with the inlet manifold they would have to change the manifold as the sensor was not an individual item. anyway, in the course of their investigation they had to disconnect the battery to clear the computer memory as there were too many faults showing. I didn't have the manifold changed, but the car never played upagain, so can only assume that clearing the computer solved the problem, so get your radio code, disconnect the battery for half an hour and see if that helps.
alf.