I agree that the behavior sounds defensive. I typically see this when the animal is going into a shed (or is in deep shed) and wants to be left alone or when the food item is too large and the snake is intimidated/fearful.