Snakes appear able to "feel" a shed coming before we can see any evidence, so there's that possibility.
Also, he could have a tummy-ache, for example. Recently someone mentioned about their snake being suddenly moody, then right after that the snake did 4 big dumps-
so apparently the snake had a "tummy ache" (& wanted to be left alone), since after that the snake went back to his own sweet self.
Something else might be going on: unfamiliar scents in the room maybe? other pets? kids teasing? things causing vibrations? (motors, bass/stereo, earthquakes, etc).
Don't take it personal...