It is a quite common kind of experience. It occours near the border between sleep and awakeness. It can also be started intentionally. One way to do this is if you let some music run in your head before falling asleep. Another way is to count during falling asleep from 1 to 3 several times and to count then suddenly just from 1 to 2.