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...