AI is a complicated(and very interesting)part of a game.
I recommend you to learn the script, and not to just find things from Assets. Unity website has a set of scripting tutorial relevant to its product.
When starting from scratch, it is a good idea to bring a pen and paper, and write down(and draw) what you want. Then you can decide what function should be in a script, and how would you do it.
*For example, about the AI you described.
-You neatly wrote down what it should do. Good.
-Now you need to decide what the AI should be capable of:
1. "If a player is nearby" : Determining range with another object.
2. "and detected" : Determining whether an object is 'detected' to it.
3. "Run at the player" : Controlling an object(its body).
4. "Avoid obstacles" : Pathfinding.
-Then, think how you would create each functions. This requires knowledge in script you're using.
1. Should be a basic math. All hail to Pytagoras.
2. Depends on what kind of game it is, but we have a decent technic called raycasting.
3. Again, should be basic in Unity.
4. This is the tricky part: depends heavily on what kind of game it is, brute-force solution tends to eat up a lot of processing power, and end result isn't pretty if you get it wrong. There are several algorithms you can find, though. A famous one is A*[A-star] - it works in (2D or 3D) grid.
(Usual(and practical) game AI is dependent on the environment it is operating on: Is it on 2D or 3D space? Is the space grid-based or semi-continual? Is it turn-based or realtime? What are the things the entity controlled by AI is capable of? What are the goals and desirable behavior of the AI? etc.)
Again, learn the basics first. RPG can be a dangerous trap for the beginning of your game development career since some people almost irresistably plan on something epic - huge scale, complated mechanics, and sometimes evenmultiplayer. It is most likely to tire you out. Keep your first project simple.