Your body has an invisible energy field. When you are going to sleep you are going from "body consciousness" to "soul consciousness". It is this invisible field which needs to adjust and will sometimes cause a jerk in the body. People who do meditation experience this also, its quite common - nothing to worry about. Perhaps you could try to bring in some meditation into your life and you will find that those jerks will happen less and less.
People tend to forget we are a soul in a body - not a body with a soul.
Just in addition to what I just said. It is not the brain that thinks, it is the soul - which consists of the mind, intellect and personality traits. The brain is merely the physical instrument which the soul uses to walk, talk, take action etc.
It is called a Myoclonic Jerk - but I thought that it was caused by your deepest muscles relaxing after being tense all day. You find it happens more when you are very tired after a long day, particularly if it has been physically strenuous.
I agree with catkingirl on this one - it makes a lot more sense that all that rubbish about your soul. I believe we have a soul but not that it controls physical things like walking & talking etc.