TL;DR: I wouldn't worry about it, and would place this slightly below availability of complimentary hand moisturizer in economy class bathrooms on my list of priorities when choosing an airline.
Airlines hate to divert planes anywhere, since it royally messes up their schedules and causes all sorts of knock-on effects. When they do have to do this due to terrible weather, medical incidents or whatever, pilots usually choose large airports with good amenities so they can refuel, offload sick passengers to a waiting ambulance, etc, and it's those same airports that usually have transit lounges as well. Not that it really matters: unless there's something wrong with the plane itself, passengers typically stay on board and terminal amenities are irrelevant.
And since the plural of anecdote is data, here are the four times I've ended up diverted in my 700k+ miles of flying:
- LGW-TLV, diverted to LCA to refuel because of strong headwinds. Passengers not allowed off, took off again about an hour later.
- AUH-SIN, diverted to BOM due to sick passenger. Sick pax offloaded, rest
stayed on plane, took off again about an hour later.
- SIN-KUL, diverted to PEN because of terrible thunderstorm at KUL. Passengers were allowed into terminal for about an hour before we tried again.
- SIN-CGK, diverted back to SIN because of engine problems. Passengers released into gate area while a new plane was prepped, took off about an hour later.
And if the volcanic eruption/terrorist outrage/Godzilla rampage really hits the fan and everything is jammed up for days on end, usually airport authorities make exceptions and grant temporary visas to those that need them. But even the absolute worst scenario is being cordoned off in a gate area for a while; you're not going to be charged with illegal immigration or something just because your flight was diverted.