I wasn't able to drive for more than a year after the concussion I sustained and it had nothing to do with medication (because I wasn't taking any). I'm still not able to drive on the freeway because my brain can't process all the pieces fast enough in order to drive safely.
But I am able to drive short distances on side streets now. It took about 16 months for me to be able to drive on side streets for short distances.
It was only after I started going to speech therapy, a year after sustaining the concussion, that I got better and was able to function well enough to do so.
Just do what your Dr. says and take it easy. Take the naps you need.
Go to therapy and see if it helps you to recover.
Did he say whether physical therapy might help you get out of the pain you're in that necessitates the pain meds you are taking? Physical therapy helped me too.