A friend of mine is addicted to pain pills and pregnant. She wont stop so her doctor told her that once the baby is born it most likely will have to spend a could weeks in the nicu.
I would discuss this with your doctor. Tell them your concerns and they can provide the best advice. The person you were talking to at the doctor's office - was it a nurse or the actual doctor? If you haven't seen a doctor since the beginning of your pregnancy and this was your first visit, it is likely that you were seen by the nurse practitioner (which does not offer me advice). Only my dr offers advice.
I do have to say that in my own opinion, taking pain pills or any UN prescribed medication for 29 weeks of pregnancy is not very healthy or good for the baby at all. I would expect some reprocusions such as drug testing once the baby arrives, the potential for your baby to go thru withdrawls (before or after birth), and you will likely have withdrawl symptoms too. I wish you would have sought help sooner as there are many SAFE things you can do to relieve a toothache while pregnant besides take medication off the streets.
I do think you should stop taking them. But how and when to stop taking them should be discussed with your doctor. Like anything else (caffeine, sugar, other simple things, alcohol or drugs), there are withdrawl symptoms when you stop consuming. I think at this point it's just a matter if your baby experiences them in the womb, or outside the womb, depending on when you stop taking them.