Has anyone suggested guards have a group object? I think the flag in the ground for barracks is good. But the selected group can then be assigned a path. linked list of destinations, back to the starting point.
This could also be a game element. A barracks upgrade for a captain unit. I think of it like the town hall, the barracks is the town hall of defense units. Then the captain is the storage cart of the defensive units - with pathing.