Testing for structures near players
Solution 1:
Note: this Answer is based off the assumption that you are making that structure using a command or making it yourself. Sorry if this is not correct.
A) Marking the structure:
First, whenever that structure is spawned, summon an armorstand in one of those blocks with the NBT tags Invisible, CustomName and Marker. (Ex. /summon ArmorStand x y z {Marker:1b, Invisible:1b, CustomName:bob}
)
B) marking the player as near the structure:
Make a dummy scoreboard (example name:nearS) Now add this command to a 20 t/s clock: execute @a ~ ~ ~ execute @e[type=ArmorStand,name=bob,r=1] ~ ~ ~ scoreboard players set @p nearS 1
and this command also on that clock: scoreboard players set @a nearS 0
(making 20 tick/s clock)
Then, you can distinguish which players are near it and which are not by their number on the scoreboard nearS.