How Can I run a part of code or script each 2 minutes

This ugly way is a solution for push notification replacement(In Iran is not working properly) and also updating Geolocation because I couldn’t solution to this problem: