Snakes do have a brain, but that doesn't mean it's just like ours. Of course, I can't speak for every human either...
If I'm reading your description correctly, she's just exploring the "ceiling" of her cage, & isn't averse to bending over backwards now & then. I wouldn't worry about it- if you were confined to a small room, you might get just as creative. When to worry is if your snake seems dizzy, unable to right themselves if gently put on their backs, uncoordinated when grabbing prey, & truly staring upwards for a very long time ("stargazing"). Most of the time, snake-keepers hear about this symptom & worry needlessly by reading too much into their snake's temporary activity- I hope that helps.