According to different appraisers I have spoke with all sales are taken in account when considering value. It is a weighted average in the sense that if there are only a few foreclosure (or pre-foreclosures like short sales) then the effect is not as great compared to if there are many in the neighborhood. Most appraisers are working within 1 mile and 3 months to pull closed sales for comparison.
If a neighborhood has several foreclosures, it indicates a declining market situation and that can affect values of even the most updated home. Condition does play into it (dead grass, broken windows) but mostly it is a square footage of lot and building that sets the basic value.