I believe party slots are determined based on join order, rather than what order you rearrange them in for formation. If that's the case, then this trigger will always find the main character since you can't kick yourself out:
IF
InPartySlot(Myself,0) // If I'm the first one in the party
THEN
...
If that works, then this should detect NPC's:
IF
InParty(Myself) // If I'm in the party
!InPartySlot(Myself,0) // but I'm not the main character
THEN
...
Of course, this will not work if you created more than one character (ie. Multiplayer). You could also put a piece of code in the dplayer scripts, since PC's are the only ones who get dplayer2.bcs, and only NPC's get dplayer3.bcs. But then, both of these scripts are turned off when someone turns off the AI. If you want to do a check for multiple created characters (even when the AI is turned off), the only other way I know of is to use the Name() trigger (even though there will constant updates needed) and put the script in the Override slot.