Alright, I've looked through the actual, current game source and found the magic equation. It casts Miracle when:
Current health - damage monitor < 10 + (random number between 0 and 1)*12
0 is inclusive, 1 is not.
In other words, it may cast it when current health - damage monitor is anywhere from 11 to 21.
Current health - damage monitor could even be 10 without it casting, but this is very, VERY unlikely.