Thanks that is good information.
To elaborate a little further. The panoramic sunroof was available as an option until sometime in Q4 2018 when it was removed from online configuration utility. There are a few cars (like mine) that were built in early 2019 and have the sunroof (off-menu option before it was completely phased out).
I would say the majority of Model S cars made between 2012-2018 have the sunroof. Some people opted for the metal roof and a few went for the solid glass (but that was more rare). More than likely an older Model S will have the sunroof but always better to check if possible.
If I were looking for a used Model S and balancing cost and other options, my sweet spot would be a mid-2015 85D (which I purchased used in 2019). The interior in the 2015 is not that far off from the 2016-2021 models.
More detailed reasoning:
1. Next Gen Seats (2015+)
These seats are significantly more comfortable that the previous seats which felt like sitting on a park bench (at least to me).
2. AP1 Hardware Standard (2015+)
Prior to 2015, AP hardware was available as part of an optional tech package and prior to 2014, was not available at all.
3. LTE Modem (mid-2015+)
Prior to the middle of 2015, the connectivity used in the car was a 3G modem which is no longer support and won't work. You'd need to either upgrade to the LTE modem ($500) or better yet, the MCU2 system ($1500-$2000 depending on whether you want to keep FM/XM radio).
4. Drive Unit Revisions (2012-2015+)
The drive unit was revised several times between 2012 and 2015. 2015 units are pretty durable and do not appear to have the same failure rate as earlier units although it is more likely that an older Model S - (e.g. 2013) would be on its second or third drive unit already. Note: the coolant issue with the LDU seals only affects RWD and Performance cars. Standard dual motor models do not have the LDU so it's not a failure point.