The P2004 is Intake Manifold Runner Control Stuck Open (Bank 1) and the P0171 is System Too Lean (Bank 1)
The plates/flaps are not closing causing a leaner than normal condition which which might be giving you the P0420 Catalyst System Efficiency Below Threshold code. However, the cat code might very well be a completely independent problem.
The intake runner issue needs to be fixed first before seeing if it clears up one or both of the other codes.
Common causes for the intake runner sticking open are:
Defective IMRC actuator solenoid
Loose or binding intake manifold runners
Bad intake manifold runner position sensor
Open or shorted wiring in the IMRC actuator solenoid control circuit
Corroded IMRC actuator solenoid connector
Faulty MAP Sensor(not equipped on a 2004 Ford)
The actuator should be vacuum operated on your engine(I believe it is on the 2.3L) so check the vacuum line for cracks/damage/connected. You might have to look/work from underneath as it's probably not accessible from the top. The solenoid will control the vacuum to the actuator on this type of setup and that would be the next thing to check.
This thread is relevant to your 2004 2.3L: (40) p2004 code--anyone have manifold/solenoid photos? | Focus Fanatics Forum
Probably the Photobucket fiasco took out the pics when the site tried to charge everybody on earth hundreds a month to stay on their site. Talk about a pissed off planet!
Watch that the actual shaft in intake manifold is not leaking itself too, sometimes it rather than the actuator or vacuum supply is a problem. Need to look under manifold to see if the common PCV hose bad issue is not there too.