I used to be a head banger as well. I was always told that you can't do any serious damage by head banging as your body will ensure you don't hit your head too hard, however I was being told this by the same staff who were medically neglectful and abusive, so who knows if it's true. I would say of course your head is going to hurt after that, but if you develop any vomiting, confusion, severe dizziness, new vision changes, or other signs of a concussion get yourself checked out. I never had any issues other than a killer headache but just be careful and if you notice any new symptoms go have a doctor look at you. When it doubt, get checked out.
As far as fighting the urge, is there anything that would be an okay replacement? Would you be able to hold ice, take a cold or hot shower, do intense exercise? I know they aren't the same but maybe you could attempt them for at least a minute or two? I'm sorry you're hurting.