Hi Uday,
There are only 2 ways to assign relationship for account and territory.
Manually assign the relationship in account details with assignment type overriden.
Or generated by territory rules automatically.
As you want to "automate" it, rule is the only option.
I have the BOM item deletion incident in status customer action.
I will try to give you a call and explain both. Hopefully, we may have some new idea.
Spencer