uchihaMadara
Although you're absorbing a fraction of anything through the skin, I can't tell you if it's better with extra sun exposure. It's difficult to tell without a baseline cellular magnesium blood test, not a serum mag. blood test. ATP require a magnesium ions to work properly inside cells, extra-cellular/serum magnesium levels are poor indicators of magnesium status.
Vitamin D3 is primarily involved in Calcium absorption. Magnesium is an integral mineral however and required for life.
What have you tried for insomnia already? How do you think magnesium is related?
Also, if you're trying to increase Mag, what about the other nutrients, especially Vitamins A, K, Minerals Boron, Zinc, and many others?