Yahweh does many things for the sake of His Name, to maintain a good reputation. This might sound self-focused, as if Yahweh were a particularly large version of the ancient hero.
I think something like the opposite is the case. Yahweh shows mercy to Israel, refrains from judging them with a final judgment, “for His name’s sake” (e.g., Isaiah 48:9). Yahweh is concerned about His reputation, but the underlying point is that His reputation is so bound up with Israel that the end of Israel would be the end of Yahweh’s name.
In defending His Name, Yahweh is not self-focused; He is Israel-focused.