I recently watched a documentary discussing snake evolution, and how their skulls are adapted for extreme G-force since they strike with such ridiculous acceleration that their brains get banged around!
Snakes are evolved to whip their heads into targets without sustaining injury, so though I wouldn't want my snakes to bash their heads into screens or glass walls regularly, once in awhile won't do much harm.