Here is my Garrison script project. It allows you to task a group with garrisoning a building, where they will stay quite well underfire but will engage if not pushed on.
you define the unit it is used on and the radius within which he will search for buildings. This building list is then chosen from randomly for garrisoning. adding a much needed random element to the placement of units in urban environments. I use it to make towns a little more lethal. having to check every window and door before clearing out a building adds a real edge to urban and cqb gameplay.
I hope you enjoy it as much as i do
Full readme is enclosed in the file.
p.s: I forgot to add that the script only covers Zargabad, Takistan, Lingor and Fallujah so far as they have the most enterable buildings. (Fallujah i'm sure was around 10000 hehe)