I'm not exactly sure what you'd like to do. The "canonical" way to make a garrison script is using monitor_conditions I_SettlementUnderSiege