This is possible, I have a similar macro that counts the distance from the nearest Wi-Fi point to me, and also counts my speed in 60 seconds and based on this data changes the GPS update time and turns on Wi-Fi when approaching.
If the question is still relevant, I can trim the macro (erasing personal data) and send the main difficulties.
The only thing is that I have never used the "Send file" action and do not know how to properly synchronize between devices.
Most likely, one device will record the coordinates of the location, and the other will receive them and compare them with its own, if you put a distance of, for example, 100m, then write the middle of the segment between two points to the file.