The problem I have in general with regain-power-type uses of spells like miracle is that they're easily abused. The party cleric has, in theory, up to three uses of miracle a day. If each one is capable of regenerating a substantial piece of the party's complement of abilities, among others things it makes attrition an extremely difficult game to play as a DM.
That said, I don't think turning uses are all that powerful, and 5k XP might be a bit steep. But I think free is too low as well.
As for just allowing the miracle to overcome the situation, given that it is an effectively epic level encounter, I don't feel that this would be appropriate. As I rule I don't like a single lower level spell being able to defeat a higher level challenge unless a great deal of creativity is used. Bypassing it would be something else, and they still have that option.