Hello,
It's me again

. I've been looking around your "issue" and found something. Maybe it won't bring any performance benefit and there is a chance you've already tried that way. But it's worth a try IMHO.
It is possible to check whether there are any agents logged in with particular skills using IRD functions MultiSkill, ExpandGroup and SelectTargetsByThreshold. Function "MultiSkill" is used to define dynamic agent group based on skill (generally - on logical expression). Returned string is passed to function "ExpandGroup" that returns list of agents belonging to that group. Finaly, function "SelectTargetsByThreshold" returns list of agents that fulfil defined condition. In your case, non-empty string means there are some agents available so call could be routed to such dynamic group.
[code]vTargetGroup = MultiSkill['<...Statserver name...>','<...skill expression...>']
vExpandGroup = ExpandGroup[vTargetGroup]
vAgents = SelectTargetsByThreshold[vExpandGroup,'StatAgentsTotal',0,ReadyIfGreater][/code]
It would be nice to have possibility of using the function "SelectTargetsByThreshold" without expanding the group as the function "ExpandGroup" has negative performance impact and usage isn't recommended. But it doesn't work without it.
What do you think about that?
R.