Tail wagging is a well documented behavior but not every beep does it for the same reason or all the time. It usually pops up either during feeding or mating/courting and the theory that i run across most often is that it's linked either to a hormonal response or elevated frustration for the snake.