"To change one's mind," in the New Testament means to repent. When the Bible speaks of my repenting or your repenting, it means that we are called to change our minds or our dispositions with respect to sin—that we are to turn away from evil. Repent is loaded with these kinds of connotations, and when we talk about God's repenting, it somehow suggests that God has to turn away from doing something wicked. But that's not what is always meant when the Bible uses this word.
Using a word like repentance with respect to God raises some problems for us. When the Bible describes God for us, it uses human terms, because the only language God has by which to speak to us about himself is our human language. The theological term for this is anthropomorphic language, which is the use of human forms and structures to describe God. When the Bible talks about God's feet or the right arm of the Lord, we immediately see that as just a human way of speaking about God. But when we use more abstract terms like repent, then we get all befuddled about it.
There's one sense in which it seems God is changing his mind, and there's another sense in which the Bible says God never changes his mind because God is omniscient. He knows all things from the beginning, and he is immutable. He is unchanging. There's no shadow of turning within him. He knows what Moses is going to say to him before Moses even opens his mouth to plead for these people. Then after Moses has actually said it, does God suddenly changes his mind? He doesn't have any more information than he had a moment before. Nothing has changed as far as God's knowledge or his appraisal of the situation.
What in Moses' words and actions would possibly have provoked God to change his mind? I think that what we have here is the mystery of providence whereby God ordains not only the ends of things that come to pass but also the means. God sets forth principles in the Bible where he gives threats of judgment to motivate his people to repentance. Sometimes he spells out specifically, "But if you repent, I will not carry out the threat." He doesn't always add that qualifier, but it's there. I think this is one of those instances. It was tacitly understood that God threatens judgment upon these people, but if somebody pleads for them in a priestly way, he will give grace rather than justice. I think that's at the heart of that mystery.
Is God confused, stumbling through all the different options—Should I do this? Should I not do that? And does he decide upon one course of action and then think, Well, maybe that's not such a good idea after all, and change his mind? Obviously God is omniscient; God is all wise. God is eternal in his perspective and in his full knowledge of everything. So we don't change God's mind. But prayer changes things. It changes us. And there are times in which God waits for us to ask for things because his plan is that we work with him in the glorious process of bringing his will to pass here on earth.