Typically they do this when stressed -- and it is actually a mild kind of seizure activity typically brought on by stress and nervousness.
Kee Shu does this -- A LOT, at time. And in fact with her it's usually coupled with some obsessive behaviors (she'll crane her head to the left, lick, lick, lick, look right, left, right, lick lick lick, crane her head to the left, lick, lick, lick, look right, left, right, lick lick lick, crane her head to the left, lick, lick, lick, look right, left, right, lick lick lick ...
It's best to keep a really close eye on them, and keep them as calm as possible -- I try to separate her from it when it begins to occur - talk softly to her, distract her to look/do something else, and mostly calm her down and talk her thru whatever has her stressed.
I take her for acupuncture once a month, and Dr D has her on a combination of herbs to keep her calm and "on this planet". Initially she treated her with a particular herb good for 'shock' (this behavior escalated a great deal after one day of trauma during a storm when she snuck out on me and was alone in a bad thunderstorm.) After an initial few weeks on that herb, she maintains on wild oats, a tiny bit of valerian and a low does of a tea pill designed to help this kind of behavior.
The concern is that this can escalate and become full blown seizures easily. I've had super good luck with the acupuncture - http://www.tcvm.com will take you to the Chi Institute page and on the left is a locator that will help you find a practitioner near you.
Let me know if I can help more.