While the logic in the attachment looks ok, I prefer to take a more active and direct approach:
IF NOT OUT OF SERVICE Test_5901B THEN
QUEUE TO SKILLSET Test_5901B BY LONGEST AVAILABLE AGENT WITH PRIORITY TRR
WAIT 2
ELSE
EXECUTE TRR_OVERFLOW
END IF
SECTION MYQUEUE
IF NOT QUEUED THEN
IF NOT OUT OF SERVICE Test_5901B THEN
QUEUE TO SKILLSET Test_5901B
WAIT 2
ELSE
ELSE EXECUTE TRR_OVERFLOW
END IF
END IF
GIVE MUSIC 72
WAIT 5
EXECUTE MYQUEUE
SECTION TRR_OVERFLOW
GIVE MUSIC TRR_Music
WAIT 900
DISCONNECT
I must say I do not understand the business reason for TRR_Overflow. When there are no agents logged in the caller is stuck listening to music for 15 minutes and then disconnected. If you are going to hang on to them for that long, wouldn't you want to test the skillset to see if any agents have logged in and attempt to re-queue the call?
There is no reason to remove the call from the skillset. If the skillset is out of service, the call is not queued against that skillset. The skillset will not even be listed on a Web Client real time display if it is out of service.
Bottom line - there are a zillion ways to script call flow. This script as you have it written looks like it should work, but it is not how I would write it.