I had this a lot when I was pregnant with my second child, but not at all when pregnant with my third, third time round I carried on going to the gym for a light work out right until 38 weeks, I think it really helped my circulation which I think is related to the restless legs.
Try putting a pillow under your ankles, it sometimes helps with the circulation.
I only seem to suffer from restless legs when I am overtired - even staying up half an hour later than my usual bedtime can bring it on so please bear that in mind if you do manage to get back into a regular sleep pattern.
Actually thinking about it bananas are full of magnesium and so is dark chocolate so eat some before bed. Hope this helps! You have my sympathies. My RL started when I was pregnant with DS and 13 years on I still get it