Looks like you are comparing the team ID with itself. You are pulling team ID and saying is this teamID DIFFERENT than this teamID. This will always be false (they are the same). You want to compare the teamID from the array element and the teamID of the local NPC.
I am doing NPC vs NPC in my current project and Im doing things a bit different:
Im using AI Perception component on each NPC to detect other pawns in sight. Then I filter all seen pawns by tag (teamID)
Then I compare the local tag with the sensed actor tag and if they are different I make that actor the enemy.
Another recommendation - try not to use Get All Actors with Tag at runtime (its very expensive). Use Perception AI or a smaller sphere trace to get nearby pawns and do your filtering with that list. It will make a big difference if you have a lot of NPCs running around.
This is a sample of what Im working on in case you are curious:
Let me know if you have any other questions.
Hope this helps!