I think the console may be flashing because you are calling the shell to run... it may work by just change this...

Code:
 Function SU($COMMAND,$Pass,$userid) 
SetL "SU_COMMANDLINE="+$COMMAND
SetL "SU_DOMAIN=DOMAIN"
SetL "SU_PASSWORD="+$pass
Shell "%comspec% /c su $userid"
EndFunction



to:

Code:
 Function SU($COMMAND,$Pass,$userid) 
SetL "SU_COMMANDLINE="+$COMMAND
SetL "SU_DOMAIN=DOMAIN"
SetL "SU_PASSWORD="+$pass
Shell "su $userid"
EndFunction



I guess my only question is will su pickup the system variables you are setting before it runs, without opening the %comspec%... Worth a try.