Terror organist

Today I played at the same church as 24nd July. This Sunday was, despite the likelihood, made a remembrance Sunday by the church centrally to remember the victims the terror 22nd July. As it seems, I have become my home town's own terror organist!

Luckily, I didn't have to change much of my prepared music, I just had to play a few extra pieces as part of a change in the liturgy. I did do too badly, I think, although I was distracted during the postlude and had to improvise a few bars before I could resume the music as it was printed. I also had some "ill-haps" during a intermediate piece, but this wasn't really an important part of the service, so I don't think I matters so much.

Regarding the postlude, I discovered a strange phenomenon. Some thing, or some thought, distracted my attention while I was playing. Probably because I was tired, but I don't know. Anyway, suddenly I caught myself playing on "auto pilot", my mind were wandering in memories from practice sessions the previous week just as if I was present in those memories. My hands and feet played by themselves, and my thoughts and images in my head adjusted to what I was doing, forming a very real pseudo-reality. Usually I would call this dreaming, but I wasn't asleep, I was playing the organ! Sleep-playing!? Suddenly I realised that I wasn't present in the real world, and it was then I got lost and had improvise while I desperately tried to find my way in the sheet music! Has anyone else had this experience? Why does it happen, and how do I avoid it?