In Moed Katan page 6b, the mishna tells us that we may fix a breach on chol hamoed. The Talmud tells us that this refers to a wall or a fence. The Talmud goes on to tell us if the fence or wall is leaning or breachehd in the public domain, one may do more than just remedial work or patch work. One may demolish the wall for the sake of safety.
The Shikkerdovid would like to pose a question. We know that typically, we should avoid doing work on chol hamoed that could have bee done earlier. Cleary a wall does not breach overnight or start leaning overnight. This must be a condition that took a while to occur. It must have started to lean or fall apart prior to the holiday. Clearly this should have been somthing that was taken care of prior to the commencement of th chag.
The Shikker Dovid would like to suggest an answer. The Torah is senstitive to the fact that people are not perfect and maybe even lax or lazy with their obligations or things they need do. This discussion clearly teaches, that public concerns, safety precautions or practical consideratioins overide the rules of the holiday. Even if it could have been done prior, we take all necessary steps, even demolish the wall on chol hamoed. Even if it could have been done before. It is the realistic and sensible approach to real problems.