Was the code P0302?
<blockquote>
P0301 through P0310 - Misfire Detection Monitor The misfire detection monitor is designed to monitor engine misfire and identify the specific cylinder in which the misfire has occurred. Misfire is defined as lack of combustion in a cylinder due to absence of spark, poor fuel metering, poor compression, or any other cause.
Ignition system
Fuel injectors
Running out of fuel
EVAP canister purge valve
Fuel pressure
Evaporative emission system
Base engine
The MIL will blink once per second when a misfire is detected severe enough to cause catalyst damage. If the MIL is on steady state, due to a misfire, this will indicate the threshold for emissions was exceeded and cause the vehicle to fail an inspection and maintenance tailpipe test.
I would start with checking the plug wires. A complete list of codes can be found here. Ford DTC codes
Thre are a number of things on a Focus than can cause those symptoms, but at 138K it is overdue for a timing belt if it hasn't been done. Usually though if the timing belt is the problem it just breaks on a Focus rather than slipping.