Well,
in the DetectNearby event graph, I see that you are first getting the state from your blackboard, you check its value and…you reassign the same value for the blackboard. Obviously, your behavior tree is likely to execute the same task again and again. In your case the Search Task.
You can try to start with real easy stuff:
In your DetectNeaby Task, set the blackboard key
- Attack in BeginOverlap (As soon as something enter your sphere, your are in attack mode)
- Search in EndOverlap (when that component exit the sphere, you are in search mode)
This is really basic of course but at least, you should be able to see your BT logic switching between tasks based on your state enum.