My sincere recommendation are 2009 - 2014 model VW TDI, but the EPA will have other modification toward these years. I have personally own 3 TDI, 1st: 2001 ALH that was a great car almost 300K till I got hit in an accident and was sold after repair. 2nd: 2005 BEW 186K given to my twin boys and ran like a champ, low maintenance, timing belt & glow plugs were easy to change. 3rd: 2011 Audi A3 CR TDI, the best TDI i have owned, very low maintenance, 46 MPG and sold back to VW AG with 115K.
My overall recommendation is as followed, purchasing 2009-2014 are great but these model years require major repairs or maintenance around 110-120K; DPF, Turbo, Timing Belt, and AC will fail. Along with these failures or maintenance, i would purchase it again. All these repairs can be done at home or shop, and choose wisely who will work on them. Again, EPA will further modify these cars to standards and hoping they will.
The 2001 - 2005 are great models as well, these cars are tuners favorite. Many modifcation and followers between these years. As stated by Member471, maintenance record is vital.
If your budget is in concern, stick with the 2001-2006 but ensure the major maintenace was completed. Which includes "Timing Belt", check the EGR since these years have major issue concerning soot buildup.
Highly recommend AARodriquez Crop. http://www.fixmyvw.com/
Finally, with Tune and After Market parts it'll last more than 40K or 2 years....! Then you'll be addicted to TDI and probably keep the car. Maybe looking into 2015 since they are selling for less than 20K with low mileage.