I was unable to find many studies dealing with vitamin B12 specifically as most studies deal with B vitamins in general. The studies I found indicate that B vitamins are not effective mosquito repellents.
A 2002 study in the New England Journal of Medicine comparing the efficiency of different mosquito repellents reported that:
No ingested compound, including garlic and thiamine (vitamin B1), has
been found to be capable of repelling biting arthropods.
A 2005 study in the Journal of the American Mosquito Control Association found that:
The results of a small number of published studies suggested that
vitamin B complex supplements are not effective as repellents, but
these studies were limited by the use of very few human subjects and
only 1 species of mosquito, Aedes aegypti. We extended this work with
the use of larger samples of human subjects and with Anopheles
stephensi as the test organism. We tested whether ingestion of vitamin
B supplements under various regimens affected the attractiveness of
volatile skin components transferred to glass vials. Although there
was substantial and consistent individual variation in attractiveness,
we found no effect of vitamin B supplementation.
A 1995 Brazilian study (full text in Portuguese) found that:
One untested but widely held opinion in Brazil is that oral use of
vitamin B complex is useful as a mosquito repellent. We exposed Balb-C
mice to a large number of Culex quinquefasciatus females, after giving
vitamin B complex to mice (drops by mouth). There was no difference
between mice attractiveness to mosquitoes in the vitamin B group
compared to normal, but very few of the females bite mice in both
groups, so the experiment was inconclusive. We suggest further
experiments in this subject, using other models were the animals are
more attractive to mosquitoes.
Little to no study has been done on vitamin B12 specifically. Studies done on on B vitamins as a mosquito repellent have not been shown to be effective. Given the many factors involved in this type of study further study is needed, as some of the researchers note.
There may be something to the idea that B vitamins can aid in repelling mosquito but at the moment there is no evidence to support the claim.