A couple of observations.

You have an "Exit" without a value - bad karma, expecially before an "EndIf" where it is nearly guaranteed not to work. Change to "Exit 0".

Use loop structures to simplify the logic:
code:
$sLogin=udfGetUserName()
While $sLogin
udfDoCleanUp($sLogin)
$sLogin=udfGetUserName()
Loop

Function udfGetUserName()
"Enter user login, or null to exit: " GetS $udfGetUserName
EndFunction

Function udfDoCleanUp($sLogin)
"Performing clean-up for '"+$sLogin+"'"+@CRLF
EndFunction