Would have to personally see the movement to make an accurate comment. But it sounds like the movement is voluntary and more in response to the chronic pain, rather than a primary movement disorder. However, there is a small possibility that it may represent some sort of tic. Tics are movements that you can voluntarily suppress, but the urge to make the movement builds and you feel a release when you do it. Consider seeing a movement disorders specialist (neurologist) at a major academic center for further evaluation. Good luck.