Android - Leaving work profile for Tasker
Now with your latest details, a raw approach. As you are on a stock ROM, switching GPS might not work out-of-the-box. In case it doesn't work, take a look at the Secure Settings plugin, which should be able to help out.
I assume your raw concept is: 8am to 5pm is work time, and you want different settings during work hours and after leaving work, considering eventual late-work issues. So this should preferably turn out as a single profile: At work do... and After work switch to.... So here's what shoud basically work:
Profile "Work":
Condition:
- Time from 8am Till 5pm
Task:
- Audio -> Silent Mode: On
Exit Task:
- Misc -> GPS: On (might need to be replaced by Secure Settings, see above)
Now we enter a second profile, and you probably do not even need GPS:
Profile: "AfterWork":
Condition:
- State -> Tasker -> Profile Active: "Work" [x] Invert
- State -> Phone -> Cell Near: (Scan your work cells) [x] Invert
Task:
- Audio -> Silent Mode: Off
So you see you neither need GPS nor the 15min wait loop. At 8am the "Work" Profile gets active, and switches your phone to silent mode. As you do not really need GPS, you can define some dummy Exit Task here (e.g. again switching Silent Mode on), as otherwise Tasker would automatically revert to the "before" mode.
The second profile does not even check conditions before "Work" has completed, as Tasker remembers which Profiles are active. After that, it starts monitoring the surrounding mobile cells -- which are either known by the phone as needed for telephony. If none of the surrounding cells match any of the scanned cells, the attached task is executed and Silent Mode turned off.
But why so complicated? Much easier done like this:
Profile "Work":
Condition:
- Cell Near (Scan your work place mobile cells)
Task:
- Audio -> Silent Mode: On
Done. No matter what time you are at work, your phone will be silent. And no matter whether you leave work early or late, Silent Mode will be switched off.
Although this question is already answered, and accepted, I would like to add to it.
Sounds like what you want is pure location-based profiles. Tasker is very powerful, but if you are willing to try an alternative, there is Llama. It is roughly the same as tasker, except that almost every action is location-based. It 'learns' a location you want to set up (like home), by scanning the antennae of the mobile network in the immediate area. That is a lot more energy-efficient than using GPS.
For the things you want to set up, Llama will be much simpler to configure. Let the phone learn the places you want to use in your conditions, and add one or more actions. E.g. "leave home" -> do "enable bluetooth" "disable wifi".
You won't have to worry about timings, as the profiles only change when you physically, actually move to or from a location.
Give it a try.
PS: I am not affiliated.