That was something I considered before settling on it, but for my purposes, I think it might be a consequence I can live with. As I mentioned, I've gotten good at taking out Pillagers before they can even touch my world. In fact, any player can do it. All that needs to be done is to setup your orbital defense platforms so that the only part of your planet that is "exposed" is the backside relative to where the pirates would come in from. This causes the pillagers to orbit the planet at the exit radius until they are at the point where they can then dive straight in at your planet and make it in this gap. Makes for easy pickings.
For me, though, this mod is going to be used with some custom team maps. So in the end, I'm willing to live with a portion of their fleet "deciding to stay behind" to attack someone else's world they just passed.
I'm going to do a file search, though, on aiUseTime, see if there's anything new in Rebellion that isn't listed here. (And as hard as I try, I can't get that link to actually stick you at the top of the page....) I've noted a few things that are missing in that list for Rebellion.
Yes, Militia are considered as enemies to pirates. However, unless the planet is actually colonized by the militia (vers being "NoOwner" with militia ships orbiting it), the ability won't trigger.
Fun fact I learned while experimenting with a buff that applies bonuses to the planet owner's allies' ships... if the planet has no owner, everyone is its ally....