Is there any chance that something may have been frightening him, prior to you walking into the room? I know that some BPs will assume the S position and get defensive if they feel threatened. Do you have a dog, cat, or small child in your house which may have scared the snake?
Another possibility could be mites...? I have read that they will rub on things if there are mites or ticks on them.
What is your setup/temps/etc?