Actually it is possible to repair the walls under constant siege...make sure the monsters never reach the walls. It'll cost a bit more mobile forces and casulties, but you can prevent them. Then you can repair them. Also this problem should become less so now anyway.
Actually, as cool as it be if the game were that smart, it's not. It can't tell when the last time the fortifications were damaged was, just whether there's been a battle at all within the last couple of days (or maybe turns; I don't recall off the top of my head).
Sorry.