From Wikipedia:
Automatic behavior, from the Greek automatismos or self action, is the spontaneous production of often purposeless verbal or motor behavior without conscious self-control or self-censorship.
This condition can be observed in a variety of contexts, including schizophrenia, psychogenic fugue, epilepsy (in complex partial seizures and Jacksonian seizures), narcolepsy or in response to a traumatic event. The individual does not recall the behavior.
According to the book 'The Mind Machine' by Colin Blakemore, hypoglycemia usually leads quickly to unconsciousness, but as blood glucose level falls, there is 'a window of experience between sanity and coma in which self-control is lost', and the body 'behaves on its own'.