Pain is always a symptom of a cause. As a result, it is useful for those who address causes, because it can help point to what the cause is. That is how it is a mercy.
Only for the damned is pain a cause, with some other end or symptom in mind. This is subjective however. Because, the cause of their delusion is the devil, who is the cause. Which, doesn't change the fact that pain is always a symptom.
When I contrast this with your thread's title, I perceive that you may think otherwise. If pain is a positive existence/creature, it sounds as though that would make it a cause. The devil, however, being this discussion's quasi cause, is still none the less a deprivation of God, which is not a cause per say.