You could create a class to represent a "step" in the agility course. This class would include the Area that indicates which step it is, as well as a Position and String (action) describing how to complete this "step".
Then you can simply loop thru a list of 'steps', find whichever step you need to solve by checking if your player is in Area of that step, and dynamically solve it by getting the object at the specified position, and using the specified action on that object. If no steps are found for your position, you probably failed or completed your lap, so in that case make your way back to the start.