"So...God actually changed his mind as a result of Hezekiah's prayer?"
That's what a friend of mine asked as we were discussing 2 Kings 20. I've written about this before, and it really is one of the most important passages in my understanding of prayer and how it interacts with God's plan.
So: Back to my friend's question. Did Hezekiah's prayer cause God to "change his mind"? During the initial conversation, I responded almost off-the-cuff, saying "I don't know if God necessarily had a mind to change." And after a lot of further reflection, I think that might just hold up.
I don't think it's correct to say that God planned for Hezekiah in particular to die from that particular illness at that particular time. I definitely think that God knew that Hezekiah would die with all those particulars. And I think that God had worked that event into his plans for the future. But I don't think that God planned the event itself: I don't think he designed it, or desired it to happen, or had so constructed the universe in such a way as to render it certain.
Instead, I think that Hezekiah was going to do of that particular illness, at that particular time, as a result of the natural laws that God put into place at the creation of the universe, and as a result of the free will of humanity interacting with those natural laws, and likely as a result of a bunch of other things that don't directly have to do with God explicitly planning that event.
I don't think that God "changed his mind" in healing Hezekiah. I don't think that in this particular situation, God had a mind to change. Hezekiah was going to die not because God planned it or caused it to happen, but because that's what happens in a fallen world where our bodies break down and fall prey to sickness and disease. It does not happen outside God's knowledge or control, but neither does it happen as a result of God's sovereign plan and active will.*
God's working and plan first becomes evident not in Hezekiah's disease, but in his response to Hezekiah's prayer. That is where God first takes action: That is where God steps into history and changes what is supposed to happen. He breaks the chain of natural cause-and-affect, and as a result, Hezekiah lives for another 15 years. And I actually think this is a pretty great way of understanding how our prayers can affect genuine change in the world: It's a time where God takes not just his own purposes into account, but also our own desires.
*Did God have a purpose in using Hezekiah's illness? Almost certainly - and in the same way, he also has a purpose in using our own illnesses and misfortunes. And sometimes, that purpose may be more active and deliberate, as is the case with Job. But I think it's wrong to say with certainty that any specific misfortune is "planned" by God....nothing happens without divine permission, but not all things happen by sovereign decree.