HELP WITH Very Basic AI BOT (Run, Stop, Eat)

I need help with making a simple AI bot. Full disclosure it is for a goat I am modeling in Maya. I simply want the following of my bot:

  1. When I get close it runs off wherever there’s a navmesh path
  2. When its at good distance from target (me) it stops and go back to eating.

I only need the AI part - the animations and transitions I can handle.

Does anyone have a clue how to go about this or better yet a similar avoidance blueprint?

Thanks and Cheers!