Thanks for the suggestions, but I ended up with a workable enough solution using perks. Basically I did a chain of AND checks on a conditional entry point perk; first IsCommandedActor=1, then GetShouldAttack Player=0, and finally IsHostile Player=0.
(This is for my http://skyrim.nexusmods.com/mods/22538/ mod, BTW.)
The first part determines if they are a summon. Minions will also fall in this category, but I have a separate check for IsPlayerTeammate so that is as I want. The next part checks if that minion would normally be hostile on sight to the player, which catches the vast majority of situations where I would want to avoid damaging them since there aren't many minions that are neutral while commanded, and last, the check for whether they are CURRENTLY hostile, which allows spells to hit targets that aggro due to friendly fire, or other strange circumstances.
Since the whole point was basically to have a toggle to stop spells and weapons from damaging the player's current teammates or minions, it wasn't so important to know if they were actually the player's or not. Those checks suffice, and also prevent damage to teammate's minions like Serana's risen dead.
I have to say, the conditional systems of this latest CK, perks and ability spells especially, are much more powerful than previous incarnations and save a ton of scripting for simple things like this.
