There are some good trigger tutorials in the Ed Depot, particularly in the Getting Started section. Read through those and you'll find yourself able to answer most of this question yourself.
Let's keep it simple. Say you want your loon to go to behaviour aware when the enemy is detected. Create your trigger.
Axis a, axis b etc: as you like
Activation Box: East detected by West
Condition: this (which is the default, just leave it alone)
On activation: loon1 setbehaviour "aware"
If you want lots of things to happen when a trigger is fired, it is easier to write the code in a little script file and get the trigger to start the script
On activation: [] exec "happeningscript.sqs"
To learn about script files start with snYpir's "Friendly Intro to code snippets".
To make the patrol groups you need to synchro the trigger (which must be type switch) to the cycle waypoint of the patrol. There is a specific tute on switch triggers in the Ed Depot.
To see all this in action have a look at the Tutorial Mission.
All available in the Editors Depot.