Yes, that's also correct. A single equals sign is always assignment, a double (or triple) equals sign is always comparison.
Of course, I don't understand why you've included those two lines of code -- they don't DO anything.
In english, they say "If $S2 is zero, then assign zero to $S2. Otherwise, assign the current value of $S2 back into $S2."
In either case, you're just reassigning the value to a variable that it already contains.
Take care,
Nik
http://www.bigaction.org/