Hmm... There's no action that compels an unit AI to take the flag... At least I didn't tried. What you could do is make a trigger and place its center over the flag. Make this trigger's radius to 3 or 5 meters and, if it's activated by a certain unit, it should execute the following command:
MyFlagPole SetFlag??! MyAIUnit
Check the ComRef for the appropriate command! I forgot its syntax, but at least, it will give you an idea of what you should search at the ComRef.