are you making sure you end your Case statement correctly?
Select
Case $Command1
While 1
$Pixel = PixelSearch ( 0, 0, @DesktopWidth, @DesktopHeight, 0x000000)
If Not @Error Then MouseClick ( "left" , $Pixel[0], $Pixel[1])
WEnd
;Script Has Now Ended
While 1
$Pixel2 = PixelSearch ( 0, 0, @DesktopWidth, @DesktopHeight, 0x111111)
If Not @Error Then Msgbox (0,'', 'blah blah' )
WEnd
EndSelect