I have seen tail wagging is several species of lizards while feeding. It seems to be an excited response. If it has any evolutionary benifit, my guess is that could help distinguish predator from prey. When a lizard suddenly becomes aware of movement in close proximity, the wagging tail will attract the attention of the predator allowing the lizard to escape only risking its tail. If the movement is caused by prey then it will freeze or flee from the movement. Another possiblity is that it could signal another lizard as to the location of the prey. With fast moving prey, the first lizard would have a better chance of getting a meal if another lizard was in on the hunt, since it is easy to steal a meal capture by another lizard then to track it down yourself. I notice this with my waterdragons who would rather steal from each other then to hunt other prey running loose.