I would only get the NF body style in your range.
They aren't perfect cars. The engines and transmissions are mostly solid. When you read about a failed 4-cyl in these it's pretty much always a spun bearing, but it doesn't seem too common.
The 4-cyl have a couple minor issues like the oil control valves failing.
The real issues with these cars are in the auxiliary systems like ABS/traction control, airbag and fuel tank emissions systems.
My 2007 Sonata was pretty problematic, having several issues that really only the dealer could diagnose or repair because they were in the proprietary Hyundai systems. But, it appears I may have just got a lemon.
They also have bad driving dynamics, but the person in question probably doesn't care about that. They have soft suspension and a squishy brake pedal. Hyundai terribly botched the clutch actuation and throttle programming, so the manual transmission cars are pretty unenjoyable to drive, but I doubt the buyer in this case would want a manual.
On the good side, they have lots of standard safety features including traction control and lots of standard airbags.
If I were to get another one, I would get the post-refresh model. I think that included 2009 and 2010. In 2011 they moved on the YF Sonata.