Here's how I decide to handle them.
If I see them out climbing around, then I figure it's a good time. I know if I'm in my bed sleeping and somebody comes to screw with me I don't appreciate it, so I figure most animals are the same.
I don't think snakes can really learn much, but who knows. Maybe it will come to associate climbing around to being let out and being in it's hide to being left alone.