How do you get Peds to stand still upon completing a task/clearing tasks?

I've added a ped off of the street to a group created by a script, and when added to the group the script clears that ped's tasks. The ped will typically stop whatever animation they are doing and begin to wander off. When giving the ped a task (such as walking to a certain pos), the ped will complete the task, then begin to wander again.

I just want the ped to stand still upon completing a task/getting tasks cleared, until another task is assigned. Could anybody help me out?