Great guide - real neat idea that we have all these possible causes on one thread.
My P0171 story goes as follows:
Car started idling rough around 25,000 miles. Knew from previous car that air sensors get dirty so I tracked down the IACV solenoid and cleaned it with carb cleaner. I cleaned it when the engine was warm and the IACV gasket did seem mis-shapen.
Anyway, idle problem would come and go - one day fine, next day problems. This situation continued and I didn't have chance to look at it for 3 months.
Thing that brought mine to a conclusion was when my car started overheating! - I was losing coolant.
Turns out that the IACV gasket must have been leaking water into the air intake. I bought a new gasket and haven't had problems with idle since.
Moral of story is - either clean IACV when engine is cold (so gasket doesn't get misshapen) or buy a new IACV gasket ($8) when cleaning the IACV.