I had similar debilitating insomnia for a long while.
Part of the problem was metal poisoning, which you are already aware of.
The other part of it which caused the most intense insomnia was parasites.
I think you should hit the anti-parasitics very hard when you are in this situation, partly because you have nothing to lose and everything to gain and part because it would be a good scientific test to see if this is one of the underlying causes of your insomnia.
One of the best things that worked for me was fresh pineapple juice. I think liquids work better than some herbs just because there is more surface area as they travel down the tract. You can even play cat and mouse with the parasites by eating something verboten like chocolates, or cakes, and then about 20 minutes later follow it up with 1 quart or so of fresh juice. Eating some junk food first can relax the intestines or feed the parasites, or at least trick them into thinking they are getting fed and then a wave of fresh bromelain descends upon them and they die rather quickly.