***** NOT A TEACHER *****
In my OPINION, your sentence is correct if you mean to say something like:
"I did not have any plans (desires) to see a doctor, but then I decided that it might be a good idea to see a doctor after all."
Sometimes it is easier to analyze a sentence if one simplifies it. So let's remove the negative. We then get:
"I was about to see a doctor, but an emergency occurred so I had to cancel my appointment."
My books tell me that such a sentence means something like "I was planning to see a doctor VERY SOON, but an emergency ...."
If you put the negative back in, then you get the idea that "I definitely was NOT planning to see a doctor very soon, but I changed my mind because of the pain."
I consulted Walter Kay Smart's ENGLISH REVIEW GRAMMAR and Pence and Emery's A GRAMMAR OF PRESENT-DAY ENGLISH for my opinion.
P.S. I shall let other members comment on whether or not your sentence needs any punctuation.
Interested in Language