No way for me to say really for sure as I wasn't there to see it and I'm still learning the body language of ball pythons a bit but I know some of mine will wrap around my hair tie while my hair is in a ponytail. They like to grip things to feel secure I've noticed. Especially with their tail. Some of mine act really uncomfortable if their tail isn't wrapped around something so I'd guess maybe that's what yours was trying to do.