Is there any way of calculating, on the whole, whether violence has been good or bad for society.On the whole, the effect of violence has to be negative. Violence never achieves anything good. It doesn't even repair the damage caused by other people's violence. All it does is prevent other people's violence from doing further damage.
Yes, violence stopped Saddam Hussein, and that was a good thing. But the world is still far worse off than it would be had Hussein never engaged in violence in the first place. Even preemptive violence can only cancel out the effects of predicted future violence; it still can't actually make things better than they would be without any violence at all.
The same goes, by the way, for passive defense, such as burglar alarms, locks, insurance, etc. These are huge industries that produce nothing at all; all they do is prevent loss that would otherwise occur. If there were no burglars, nobody would need to spend money on locks and alarms, or insure against theft. If there were no arsonists, the need for fire insurance would be less, and more people would choose to do without it and do something productive with the money. Unfortunately we don't live in a universe where this is possible.