Here is a rough draft of how the target types work for units.
Target Types: Allied, Enemy, Friend, Neutral, Player Units
Allied: Can target Allied players
Enemy: Can target Enemy players
Friend: Can target Allied players and Yourself
Neutral: Can target Neutral Passive
Player units: Can target Yourself
None: Can target All players
Target Types: Self, Not self (Ignores Target Types: Allied, Enemy, Friend, Neutral, Player Units)
Self: Can target Self
Not self: Can target any unit that is Not self
Both: Can target any unit
None:
Target Types: Alive, Dead
Alive: Must target a living unit
Dead: Must target a dead unit
Both: Can target living and dead units
None: Must target a living unit
Target Types: Invulnerable, Vulnerable
Invulnerable: Must target an Invulnerable unit
Vulnerable: Must target a Vulnerable unit
Both: Can target Invulnerable and Vulnerable units
None: Must target a Vulnerable unit
Target Types: Hero, Non-Hero
Hero: Must target a hero unit
Non-Hero: Must target a Non-Hero unit
Both: Can target Hero and Non-Hero units
None: Can target Hero and Non-Hero units
Target Types: Air, Ground, Structure, Ward
Air: Can target Air units
Ground: Can target Ground units
Structure: Can target Structures
Ward: Can target Wards
None: Can target all units
Target Types: Mechanical, Organic
Mechanical: Must target a Mechanical unit
Organic: Must target an Organic unit
Both: Can target Mechanical and Organic units
None: Can target Mechanical and Organic units
Target Types: Suicidal, Non-suicidal
Suicidal: Must target a Suicidal units
Non-suicidal: Must target a Non-suicidal units
Both: Can target Suicidal and Non-suicidal units
None: Can target Suicidal and Non-suicidal units
Target Types: Ancient, Non-Ancient
Ancient: Must target an Ancient unit
Non-Ancient: Must target a Non-Ancient unit
Both: Can target Ancient and Non-Ancient units
None: Can target Ancient and Non-Ancient units
As an example with your current Target Types of Enemy, Hero, Structure, Ancient and Mechanical would mean the spell must target an enemy-hero-structure-ancient-mechanical unit.