Create an alert trigger that looks for interfaces that have been down for xx days.
Then create a trigger action that runs an external program (vbscript or otherwise). That VBScript will need to connect to your database, and set the interface to "unmanaged" with a particular end date.
THEN create a report that you check daily/weekly/whatever that shows the interfaces which are unmanaged, so you can either go in and delete them for good, or fix them and re-manage them.
You could also do this through the SDK as a completely separate process.