Why aren't you simply selecting the ship, pressing SHIFT-S to open the ship editor and changing the IFF there?
The ships register as hostile when I do it

of the time. Sometimes (but seemingly rare) it works. It worked at first, then it went back to hostile. Most the missions that have been damaged by this were deleted a while ago in favor of my new methood, so I currently don't have any, and ATM, it's working (don't expect it to last though

like last time).
I've found the IFF in the ship editor thing to stop working (for me) after "friendlifying" several wings of shivan ships, and it's especially bad when the player wing has shivan ships in it. I'll work on gettting a friendly=hostile situation going on and post the mission, but it may take some time, and probly destroy another misison.
Of course, I *MIGHT* get lucky and it'll start working (make things

easier).