I want to make a secret room with invisible armour stands with text, but I don't want the armour stand names to be visible from outside the room. I thought of a way to fix it, but using a radius command on the armour stand to make it visible when a player is near doesn't work with multiplayer; a player outside of the range would be able to see the armour stand name if someone else is in range. How can I fix it so the name is only visible through air, not blocks?
Seems like you have already tried everything that I would try. There's no other way, names are always visible through walls.
The best other option might be to have a renamed item in an item frame. That will only be visible when looking at the item frame, which requires an unobstructed line of sight.