If an automation chain doesn't exist , user action and event handlers that reference it should be marked as not valid.
As well, automation chains references through createTask and Run Document should also be marked as unvalid (this is very important).