OP said:
I have a few hundred text files I open in notepad…
We hear this A LOT!
We always ask how practical it is, and no one ever explains it.
Wouldn’t it be simpler for you to manage the opened files with:
Window -> Windows …
In my answer I inferred that OP was already using Window > Window… menu in order to sort tabs, because how else could you do it?
Activate the tab you want with double click or Enter.
OP is wanting auto-selection of a “reasonable” tab after closing one – clearly if OP wanted to click on a tab they would just do it (and wouldn’t have posted a question).
BUT… your information is good for other readers that may come here in the future looking for answers (and don’t know about Window > Window… menu).