Could you please post the current script?
A revised version of the script could be used by smart rules, e.g. triggered on tagging.