"Far be it from you to do such a thing--to kill the righteous with the wicked, treating the righteous and the wicked alike. Will not the Judge of all the Earth do right?"
Abraham is not pleading to change God's will. The story wasn't written to give an account of history but as narrative theology. This is a righteous God, who for the sake of ten righteous people, would not wipe out the entire wicked city. Because of ten righteous people, the entire cities of Sodom and Gomorrah would be spared even though everyone but those ten were wicked. That is the scope of the grace of God.
However, "there is no one who is righteous, not even one... All have turned away, they have together become worthless. There is no one who does good, not even one." (Ps 14:1-3; Rom 3:10,12) We should've become just like Sodom. We should've wept just like Gomorrah. So why do we rejoice?
Because there was and is a Righteous One in our midst. For the sake of one righteous man, God had spared the entirety of the world. It is because that Righteous One dwells with us through the power of the Holy Spirit that our cities are spared. And not only does this Righteous One dwell with us, he is only present because God himself sent him so that he might spare us. That is the scope of the grace our Lord Jesus Christ. This is the present reality we live.