It strikes me that, given that as a poster said, swine were considered unclean by the Jews that the demons were asking for a punishment.
The demons knew that the swine were unclean and essentailly asked to be punished by being sent to an unclean place. To me the demons, in facing Christ, knew “the jig was up” and that they had done wrong for long enough. They rightly asked for a judgement and Christ gave it to them. Christ wouldn’t have given it to them unless it was a just punishment. Which in turn means that the demons were truly sorry for what they had ever done to pick a level of punishment that would have OK with God. But then the pigs went over the cliff and died thus releasing the demons.
To me after that, the demons were released from even being demons anylonger.
I see a parallel with going through purgatory, i.e. purification before being “released”.