here's a thought
I've been seeing some of my snakes doing exactly that, but I think I know why.
Is there, or has there ever been some kind of opening in your tank which they could exit trough without you taking them out?
perhapse when you were cleaning your tank and left it open for a view seconds?
It seems that they have a very good memory of these things. Even if they just stick out half their head into a place where they usualy can't, they'll keep on trying for days and days to get out at that exact spot, moving dirt, objects and just being very active all over the tank. It might take over week for them to settle down.
eventually they'll forget. (until it happens again)
well, that's my theory. it might be far from the truth..., then again
good luck with it dude, if you have a theory of your own, let me know.
RIK