Let’s start with clarifying what herd immunity is.
Herd immunity is when spread decreases because enough of the exposed population are at least relative dead ends to further transmission that new infections decrease.
Resolving from an infection is one potential way to have enough immunity to be that relative dead end. Vaccination is usually a safer way, albeit not usually as effective of one. Some could be dead ends because of something else about them (e.g. other sorts of infections, or vaccinations, in the past that keep them from becoming as contagious after exposure, in a non-specific way). And of course if a specific circumstance has fewer exposed, then the fraction needed to be relative dead ends is less. More exposed? Then the fraction functioning as dead ends if exposed has to be higher.
So far so good?
Does not mean the germ fails to survive, just not additionally spread.
Does not require that every relative dead end from exposure is a 100% dead end to further spread, and in fact usually does not. I don’t know of any immunization that makes each person vaccinated 100% protected if exposed, for example, but a big enough fraction immunized with something that decreases transmission enough, still does it.
The issue with herd immunity as the end game is how it is achieved
So that as preamble let’s talk about your hypothetical isolated town.
Yes, unless something else has changed by the time they open up they are in the same place as they were before they closed off.
What can change?
One possibility is staying completely isolated until a safe and effective vaccine that can achieve herd immunity by that means is available, assuming that such some time occurs. Or until at least much more effective treatments are developed (and this requires more than a couple days shorter of hospitalizations as a meaningful outcome).
Alternatively they can better prepare for the infection to come through their town by doing any or all of the following -
They can increase their capacity to deal with the number of infections so their system does not become overwhelmed.
They can institute dynamically changing societal policies and procedures that keep spread of the disease at a rate and time of year that does not overwhelm their systems. (You really do not want a surge synchronized with influenza.)
They can develop policies and procedures that best protect the most vulnerable the most (at the least harms to them) so that herd immunity (if achieved) by infection causes the least morbidity and mortality possible.
FWIW the hypothetical is real world. China has 1.4 billion people and reports only 0.006% of thier population as infected. Okay we suspect they’ve under-reported, but even if the number is off by three orders of magnitude, it would remain that they have a small fraction infected …achieved by ongoing restrictions, both internally and for international travel preventing imported cases, that few other societies could implement for any length of time, let alone in a prolonged manner.
Other nations have achieved similar low rates by effectively isolating themselves from new cases coming in with limited travel, strict quarantine of those coming in, and rigorous contact tracing of any cases that slip in despite those measures. Not quite alligator moats but effectively the same end.
They are in circumstances analogous to your hypothetical. Their plan for now seems to be to maintain their isolation/control measures hoping for things to change, for however long that takes, and the change they seem to be banking on is a safe and effective vaccine.