Right now villages are basically doomed to death without our immediate intervention. This suggestion is a group of changes that would make villages more likely to survive and recover after a zombie attack (assuming you aren't playing hard mode and a zombie attack includes the village losing doors...)
(I know there are other threads talking about villages and villagers, but I couldn't find one that fit this well. I also know that this is multiple suggestions, but they are connected in the end goal of making villages viable without player intervention. I hope Mojang at least considers a village revamp, even if they don't take the specific suggestions here.)
1. Make villagers less suicidal. Currently, villagers will walk into a variety of dangerous situations, including walking into cactuses, walking into fire/lava, and falling into pits that they cannot escape from. So villagers would not walk into a block that damages them or jump down a height of two blocks or more.
2. Adjust mechanics so golems spawn in natural villages. The biggest barrier here is the minimum conditions needed to spawn a golem. The 10 villager requirement is fine, but the 21 door requirement is a bit high. Decreasing the door requirement won't make iron farms any easier since doors are the easiest aspect in building one, but it will make it easier for a golem to spawn to protect the villagers in a natural village.
3. Adjust villager AI so they don't all crowd in the same tiny house and make sure they make their way inside a house. They should seek a house that has fewer than four villagers since even the smallest house can handle four. There is also an issue in bedrock, and I don't know if it is also an issue in java, where the villagers can huddle under the eaves of the house or another similarly "sheltered" area instead of actually going inside. Any villager that does this is basically dead meat if a zombie comes along, but unlike a natural situation, there is no learning or behavior modification.
4. Adjust villager breeding to enable better repopulation. The current door to villager ratio basically makes it impossible for a natural village to recover. Instead of the current requirement of the population being less than 35% of the doors (so they have about three houses for every person?!), make the ratio more like 2:1. Two villagers per house is more realistic and would put any natural village that is not extremely healthy into breeding mode. At that point, the village is only doomed if there are no more brown coats to provide food. (The door issue can be entirely circumvented in a player-built breeder because of details relating to how and where the population is counted. So if the door issue seems too OP, mix the change with fixing infinite villager breeding)
(All facts about mechanics come from the wiki. If anything is incorrect, please go fix it on the wiki)
I welcome any feedback.