The God of Philosophers is immutable and does not change. However, although there are some passages in the Bible which indicate that God does not change, there are others which seem to say the contrary.
When we say that God is immutable, we mean that He has no privation, no lack: He doesn’t need to move towards a perfection, because He already contains all perfection. Keep this in mind.
For example: Exodus 32:14: “Then the LORD changed His mind and did not bring on His people the disaster He had threatened.”
I see this passage as an shadow of how the inner life of God, the Trinity, relate and interact with each other. Moses is interceding with the Lord similarly to how the Son intercedes for us, and as how the saints, the adopted children of God, relate to the Father.
And, with that said, let me specifically answer your question: God isn’t “changing” here in a way that would indicate moving towards becoming more just nor merciful. He is however changing in the particular way in which He enacts His perfect justice and mercy, instead of justly destroying His people, He instead looks to the merits of the saintly: Abraham, Issac, Jacob, and Moses himself, as balancing the scales of justice instead. Remember how I mentioned that Moses is relating to God like the Son relates to the Father? Well, Christ’s merits for the forgiveness of our sins and quelling the Divine justice we so greatly deserve works in a similar way.
Jonah 3:10 : “When God saw what they had done and how they had put a stop to their evil ways, He changed His mind and did not carry out the destruction he had threatened.”
I see this as a reminder of a purpose of Divine Justice: it is purgative, not for mere punishment or revenge. But anyway, the sin was no longer present, and so the His anger no longer cried out. God didn’t stop being just, the city stopped being sinful.
Neither of these examples reveal God to be lacking perfection, but rather reveals our own lacks and weakness.
I think you should start viewing Divine immutability as a result of perfection, and not as a lack. Think about it: God is truth, and truth is a sturdy, unmoving foundation from the storm to build a home. God will never stop loving us, He will never stop being merciful, He will always keep His promises*, etc.
Christi pax.
*Moses even invokes God’s own promises and implied immutability/refusal to break them, to plead for His pardon in the chapter you quoted!