i don't get it, what is it you want to do? my example did what you said you wanted, didn't it? did you run it?
your line 16 might be preventing the value to be set, i'm not sure if whether if 16 or 13 is going to happen first. Use ELSE like in the example, so a command takes priority.