giggles a little, it is a tad funny
could it be that he is sleep walking and is unaware that he is doing this?
i only suggest sleep walking, because you said when you were startled and screamed, he took off running and he ran into a wall. now, i dont know too many people-adults and children who run straight into walls lol
so he could be sleep walking.
have you talked to a family doctor about this?
maybe since he is a foster child, he is just making sure that there is someone there for him always, and no one is leaving him alone. he could have developed separation anxiety within the past few months.
i would talk to a doctor or pediatrition about this though if you already havent.
good luck