I would probably use a pair of text instance variables, for example:
Type="F2" (this enemy type)
EnemyList="F1,F4,F5" (what enemies are hostile to this one)
On collision with another enemy check if that's other enemy type is in the list using find(ThisEnemy.EnemyList, OtherEnemy.type) expression.
Note, that this expression only works if you have less than 10 enemy types. Also, you might want to create a family and define these variables on the family.