Thanks for the scripts. A couple of things I would like to note about them:
1. The findship command seems to only return 500 ships at a time. If there's more than this, you'll need to run the command several times.
2. This script also deletes player-owned ships. I added another check on the xenon/khaak check line to make sure none of my ships got deleted after I jumped into AP and got the nice little game over screen.

3. I could only use the first script, since none of my problem fighters had a destination set. The KE ones were on a police patrol, it seems, but the AP ones just had a single attack enemies command. The first script worked fantastically though. It seems those extra ships were giving me performance issues in the other sectors too, which are now gone.
Thanks,
--SD