“For some of the dead, indeed, the prayer of the Church or of pious individuals is heard; but it is for those who, having been regenerated in Christ, did not spend their life so wickedly that they can be judged unworthy of such compassion, nor so well that they can be considered to have no need of it.”
He’s talking about the purification of people already being saved by Christ in communion with the Church, and that’s the context wherein he goes on to talk about how some people will have to still be punished by the eternal fire after the general resurrection: some come out of purgatory before the resurrection, some after.
In your quote from the Enchiridion, Augustine says about prayers for the dead by the pious, “But these means benefit only those who, when they were living, have merited that such services could be of help to them. …] Therefore, let no one hope to obtain any merit with God after he is dead that he has neglected to obtain here in this life.” The merit Augustine was talking about involves good deeds done in the context of having already been saved into the Church; Augustine of all people wasn’t talking about meriting being saved in the first place!
What Augustine allows is that a person outside the Church might do enough good to merit reduction of suffering in hell, not full forgiveness (which is reserved for those being regenerated by Christ); but his position requires him to deny that God will not originate such mercy – God requires being convinced to give such (limited) mercy (but not salvation) by virtue of those who pray for the unsaved dead.
His reference in the De Anima follows suit: if Perpetua’s tale was accurate, that (for Augustine) means the boy must have been baptized and even in a confessionary manner. After all, she doesn’t say he wasn’t baptized, thus Augustine speculates that he entered into saving communion young but was afterward led astray by his father earning what would have been moral condemnation (but wasn’t because he had already been saved into Christ).