Finding and teleporting players to Structures

Any idea's as to the best/most performance friendly way of finding a structure, check if a player is near that structure, and if there isnt a player there to teleport the player that triggered this function to that structure?

I'm new to this and some of my idea's may not work, but i'm trying what I can.. this takes place in a custom dimension that consists only of the custom structure, placed very frequently.

Currently considering teleporting the player randomly then searching for the nearby structure, saving the coords, check for another player near those coords within a radius, if no player is there it teleports them to it

or

1 structure is generated, and on load it detects that structures coords, then uses the place command to place as many as i need at a set distance from one another. Each structure coords would be known then and can search for players nearby

Continue to help post