There are many issues with your code..
If enemy is not in range or has no LOS, all highlighted events are executed on every tick. This is clearly wrong.
Also, you need to pick the correct enemy instance in your function, otherwise you are assigning isSearching=true for all enemies.
"Wait 5 seconds" inside an event which is triggered on every tick also makes little sense.
I would add a Timer behavior to enemy and do this:
Enemy NOT overlapping NoticeRange Function call "StartSearch" (parameter: Enemy.UID)
and Enemy isSearching=false
Enemy NOT has LOS to Player Function call "StartSearch" (parameter: Enemy.UID)
and Enemy isSearching=false
On function "StartSearch"
Enemy pick by Unique ID = Function.Param(0)
Enemy set isSearhing=true
Enemy start timer "StopSearch" for 5 seconds (once)
Enemy start timer "SearchForPlayer" for 0.3 seconds (recurring)
Enemy On Timer "SearchForPlayer"
For each Enemy // as Timer may be triggered for several enemies at the same moment
............... find path etc.
Enemy On Timer "StopSearch"
Enemy set isSearching=false
Enemy stop timer "SearchPlayer"
[/code:1j18ux2j]