What Heavenfall is saying is that if you want to create a spell "Charm Snake," you would need to create a spell that targets Beasts (has <SpellTargetCreatureType>Beast</SpellTargetCreatureType> in the spell XML). Then you'd need that spell's success to depend on a UnitStat of that creature (let's call this UnitStat_IsSnake, which is 1 for snakes and 0 for anything else).
After you created this spell, you'd then need to define UnitStat_IsSnake (see CoreUnitStats.XML for how this is done), remembering to set the default value to 0 since in my example we want snakes to have UnitStat_IsSnake = 1 and non-snakes to have UnitStat_IsSnake = 0 for everything else. Then, you'd need to modify the creature definitions for all the Beast-type creatures you consider to be snakes to have them set UnitStat_IsSnake to 1 (like this: <UnitStat_IsSnake>1</UnitStat_IsSnake>); definitions for monster creatures are mostly in CoreMonsterUnitTypes.XML.
Alternatively, you could remove the restriction on valid target creature types and then just tie the success or failure of the spell to whether or not the target unit has UnitStat_IsSnake = 1. You'd still need to create UnitStat_IsSnake and set the default value as well as the correct value for anything that isn't a snake.
If you wanted to create multiple such spells (Charm Snake, Dominate Dragon, Bind Bear, etc), it would be cleaner and easier to create a single unit stat, say UnitStat_CreatureType (assuming this doesn't conflict with anything), and have that be 1 for snakes, 2 for dragons, 3 for bears, 4 for trolls, and so on. Then each of your spells could have their success or failure dependent on having the correct value for UnitStat_CreatureType. However, I don't know how the success or failure based on UnitStats is done, so I can't say for certain whether or not this would work. This combined UnitStat would also result in having to add the tag to a lot of creatures, but you'd still have to do roughly the same amount of work for separate UnitStats, and having lots of UnitStats increases the chances of conflicting with other mods or existing but hidden UnitStats (I don't know if there are any).
The other part of what Heavenfall said is that if you make the spell success or failure dependent on the target's UnitStats, you could waste mana targeting creatures that can never be affected by the spell since you cannot use UnitStats to mark different units as valid or invalid targets for a spell. Using Charm Snake as an example, even though Charm Snake only works on creatures with UnitStat_IsSnake = 1, I can still cast it on creatures with UnitStat_IsSnake = 0, and you probably won't be able to see that UnitStat anywhere. Thus, if you decide to go with the UnitStat_IsSnake or UnitStat_CreatureType route for your spells, you should probably make certain that there is a clear distinction that the player can see between what the spell works on and what the spell doesn't work on (unless your mod is for your personal use only, then whatever works for you is fine). For instance, if I make a spell that lets me take Trolls but not Ogres, and all I say in the spell description is that the spell allows me to "control some large humanoid monsters," there's a problem. With the example of snakes, there probably isn't much of an issue, as long as you remember to mark all of the snake-like creatures with the proper UnitStats, but for some other things there could be issues of how to properly communicate what the valid targets are.