The condition where you are checking if the waypoint is not equal to a faction doesn't really relate to the thing that spawned. I would expect CurFaction to not equal something on the object that spawned, I don't know what EntitiesFaction is.
What I would expect in this condition is Waypoint CurFaction is not equal to BotsPathFind.CurFaction.