I was just wondering today how city states expanded their walls. Did they have to knock them down and then build out further and start the new wall there, or did they plan ahead for this? Also wouldn’t this make them vulnerable? I mean I imagine it would be easier to take that city over while they were trying to expand their walls because of the gap. Just a random thought I had today.
You seem to discount a third scenario: building a larger ring of walls (or an extension) while the existing wall are still standing. In my own area of interest, Italian cities, there are many cases where an inner ring of old walls is contained within a newer ring (Milan, Verona, Bologna, and Florence all exhibit this). Of course, there could be differences across different time period and geographic areas.
I actually wrote an older answer about the demolition (and construction!) of urban fortifications which you might be interested in. I also wrote this shorter answer on city walls and Italian urbanism that you might also be interested in.