When I first read the question, my first thought was restless leg syndrome. Very annoying. I have it, and it only happens when I'm at rest. There is medication for that.
After I read the rest of your story, I have to agree with Tatjana Mihaela. I have been taking Calcium-Magnesium-Zinc for years, and it really helps with muscle cramps. Be sure to include the Zinc because Calcium and Magnesium tend to deplete the Zinc in your body.
I think your doctor is right about the exercize, but 5 days a week is a little over-kill for a new life style. Try every other day or 3 times a week to start out. By using your muscles more, they become in a more natural relaxed state at the end of the day, hence, they're too tired to twitch!
If I were you, I would try those two things for a couple of weeks, if there is no improvement, get a second opinion. It could be neurological. Best wishes for your recovery. Keep us posted.