You would need to look for every single block within a radius from the player using entities.
Summon an entity at the player.
Then execute detect from that entity within a certain radius (a cubic 'radius' is easier than a circular one). For a radius of 5 blocks, you would need 11x11=121 detect commands.
If one detect command succeeds, tp the armorstand to that block.
Now the armorstand is in the block and you can execute a command from it.
actually for cubic radius he needs 11x11x11=1331 detect commands. per ore he is looking for
what u mentioned is square radius
so probably make a function for this