Is it possible to procedurally call out when a current state has ended? Because now I am defining when the state duration reaches a certain time, the agent will switch to another animation.
You can get the clip length from the agent catalog. Then look at if you are in transition by examining the @crowdtransition attribute. If you are not in transition compare your @cliptime to the catalog length-@TimeInc. If the cliptime is near the catalog length then you are about to loop, which will reset cliptime.
This will effectively give you an extra event everytime a clip loops.