¿Que estoy haciendo mal?

I just wrote some code in autohotkey to do such a thing, but sometimes it doesn't recognize the code and hangs. Now my question is how can I make the code recognize that it did not fulfill the function?

For example the code below recognizes that it doesn't work and executes another option, which would be >Else

MouseMove, 0, 0
SleepRandom(2500)
PixelSearch, ei, fi, 530, 656, 530, 680, 0x18838b, 10, Fast RGB
if ErrorLevel=0
{
return
}
Else
{
SleepRandom(2500)
goto, cleanup
}
return
}

Pero en este otro no funciona me tira un error que dice lo siguiente >ELSE with no matching IF


    Else
    {
        Loop
        {
            if QueueCheck()=1
            {
                goto, inqueue
            }
            if QueueCheck()=2
            {
                goto, startqueue
            }
        }
    } 
Else
{
SleepRandom(2500)
goto, cleanup
}
return
}
How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum