Your story covers quite a bit of territory - but I suspect most of your underlying problems will be addressed at the two links listed below.
- The infamous P0171/P0174 problem is related to intake manifold problems and isolator bolt seals (depending on which model year your Windstar is - which you didn't mention). You'll find many, many references to this issue - and how to fix it dependably - on this site. However, most of what you need to know is summarized here:
http://leckemby.net/windstar/windstar01.html
- There are a number of things that can cause Windstar idle problems - but the most common is a dirty IAC (Idle Air Control) valve. Thankfully, the valve is easy to get to, and easy to clean. Take a look here:
http://leckemby.net/windstar/windstar02.html
Sadly, many shops seem to misdiagnose these Windstar problems, which causes lots of frustration. I've heard that shops commonly replace oxygen sensors - which are rarely truly a problem on Windstars (Example: My '00 still has the original oxygen sensors at 125K+ miles; they work fine).
One follow-up I've noticed: It seems that another sensor, the DPFE (Differential Pressure Feedback EGR), will fail with code P0402 at about the same time as the P0171/P0174 occurs. If it were my van, I'd simply replace the sensor at the same time as performing the P0171/P0174 fix (presuming your Windstar model year is affected the same way my '00 is). I'll also note that I've had no luck with aftermarket DPFE sensors. In this case, the Ford OEM DPFE is worth the extra expense.