Hi
I've also just had my visas sorted out recently. There are probably a number of things you need to consider. Firstly though, I wouldn't advise getting the visa application done earlier than a month before travel. This is because the visa only lasts for a period of 2-3 months (depending on the location of your embassy) and most embassies won't let you apply more than 2 months in advance.
You should also only apply using the passport you plan to travel with, as, at least with mine, the visa gets attached inside your passport and so the embassy needs to keep your passport for the period it is processed. That also doesn't take too long. We applied 3 weeks early and it was ready 5 working days later (5 working days is probably quite a long wait from what I gather of the Thai embassies) so you don't need to be worried about major delays.
Most of what you should need to bring should be on their website, such as proof of employment/schooling and proof of required funds. BUT, in our case, they forgot to mention the fee. If you can't find a quote, perhaps contact their number because our embassy required an electronic payment in advance before processing.
In my experience, the embassy was very accommodating and understands issues such as some letters using my preferred name and others my legal name. Often, you can just tell them up front the nature of your visit and you get a tourist visa with a special 'MT' (medical tourist?) added at the end. You will also need something linking to Dr Chett such as an invoice or a letter so that they can confirm your reasons are legit. Finally, make sure you have his address on hand as he will be your guarantor on the form.
In terms of the legal name change, you will have to think carefully about this. In South Africa, our department of home affairs willingly breaks the law to deny your name and gender marker change until after the operation and no amount of doctors/lawyers letters were able to change this in our case. So we eventually decided to simply apply for the passport and then the visa as nothing short of a miracle would have meant we'd've had to get new documents. However, if you can be sure that your government will process the changes 2 months or more before your journey, you can probably rely on that. How early on you need to sort out passports etc should probably be at your discretion based on your government's reputation.
In your case, it probably sounds like you have plenty of time before you need to start worrying. So kick back and let the bureaucratic tables turn! At least for us, the visas were a bureaucratic walk in the park compared to anything else we'd ever tried to organise with regards to transition. You'll probably find the Thai Embassy people are quite pleasant as they deal with medical tourism all the time! But you're definitely wise to plan for a 60-day stay if anything goes wrong

Much love
xx