I think it's definitely true that you can sometimes need to do more and more to be satisfied. This might be in part because when the body is in pain, it releases endorphins, and I suppose you can build up a tolerance to them, just like to a drug? It's probably also just in the mind - personally my mind can be difficult to satisfy.
I'm really sorry you felt you had to bang your head. Even though you didn't feel the pain at the time, I hope you didn't injure yourself. Can you take a little break from work, and walk outside for awhile, or call a friend for a few minutes, just to get a little distraction?
I really hope you start to feel better soon.