If the snake is just trying to get away, it will likely show some other signs of being agitated such as jumping or recoiling or fleeing from a slight touch or movement, or a higher respiration rate, or going faster if you try to get it to go somewhere else. Also if it's just making a frantic beeline for the closest dark hole, it's probably trying to run.
If it's moving on the slower side, doesn't overreact if you touch its body or tail, breathing at a calmer rate, changes direction without pulling its head back like it's recoiling from something, etc, it's probably just exploring. It can be a happy explorer and still find a nice hole to hide in, but that's not the same as making a panicked dash for one. The snake can also be basically happy to look around, while still preferring not to be out in the open, like sitting on an empty desk or on the floor in the middle of the room.