Have you checked what the return values of your IF statements? are any of them returning what is expected to fire the Log() function?

ex:
Code:

? "SVersion = "$SVersion
? "LVersion = "$LVersion

If $SVersion <> $LVersion
$vDiscard=Log("\\server\ctx$\citrix\"+$sKey+"_ICACLIENTVERSION.TXT"," has old ica client version "+$LVersion)
EndIf