NM, just wrote a script based off the flushtraders script. Uses tradersattackedbypirates.lua, which has the unfortunate effect that it could be used to immediately stop a 'a ship in your sector is calling for help' events, but does clean up the leftovers.
(I realize they're also cleaned on full exit/restart, but sometimes I like to just let the sector run with automated patrol ships so the factories can trade)