Create a String variable to store the agent state and set Result Statistic in the Get Reporting Statistic step to this variable. You can then reference this variable in future steps such as If AgentState == "Ready".
Hope this helps. If so, please rate the post.
Brandon