We played a game tonight with these 2 cards available. My opponent played Haunted Woods so when it came to my turn I found I could overpay for doctor by 1 and I had an estate in my hand (+ 2 other cards) that I couldn't play. Both the Doctor and Haunted Woods have "When buy" effects so my understanding is that in general if 2 effects trigger at one time then I get to decide the order that they are resolved. So I bought a Doctor, resolved the Haunted Woods effect first and discarded the rest of my hand that I couldn't play, making sure that the Estate ended up on top of my deck, then resolved the Doctor that I bought and revealed the top card of my deck and trashed the Estate that I just discarded. Then I gained the Doctor.
I just wanted to verify that I did this correctly?
Yes, although you say "discarded" in some places where you mean "put on top of your deck."
You can pick to resolve Doctor's overpay or Haunted Woods first. If you resolve Haunted Woods first, you can put an Estate from your hand on your deck and then yeeha, trash it.