Ok, the problem seems to be that the NPC that is present where I'm trying the mod (The calo encounter on korriban, aka "kor_calo") is the one who shows up on the ebon hawk after I use the following script:
void main()
{
ChangeFaction(GetObjectByTag("kor_calo"), GetFirstPC());
RemoveAvailableNPC(NPC_T3_M4);
AddAvailableNPCByTemplate(NPC_T3_M4, "n_newcalo");
AddPartyMember(NPC_T3_M4, GetObjectByTag("kor_calo"));
}
What happens is that the object "kor_calo" ends up permanently in the T3M4 slot, and the new object that isn't hostile does not. I tested it by fighting the calo fight and then checking my party and the non-hostile version was indeed there in the ebonhawk.
It all comes down really to the damn tag issue. You have to make sure recruitable NPCs have tags corresponding to whatever slot they replace or the Replication Problem (
http://www.lucasforums.com/showthread.php?s=&threadid=125631) will occur. That is why I use the n_newcalo object which has been fixed for this, however, since the kor_calo one overrites this (which I didn't think it should) it makes it irrelevant.
Also, changing the kor_calo object's tag is not an option because it breaks the ambush encounter.