Low B12 may affect sleep patterns, as it helps regulate melatonin, the hormone that sets your sleep cycle.
In my case, I use a full spectrum lamp as an alarm clock, to get a regular night's sleep in wintertime - any other time, I find I have to put something lightproof over my eyes to ensure I get to sleep. In fact I've been doing that for so long, I'm like a blooming parrot - I can't sleep without dark ! So maybe a sleepmask would help you, like the ones you get on plane flights ?
(Sleep researchers reckon that complete dark will cure even the most hardened of insomniacs, the only question is how long an individual will take to fall asleep when deprived of all visual stimuli.)