Try a beep right after the c_trace (before the if).

If that works/beeps, try your code with a model: e.g. some flat transparent model with your water texture and change the skin name it has in MED to "water2" without the quotes ofcoures. If that still won't work something is wrong with the code, if that will work than the WAD skin name isn't called water2 or isn't detected correctly by str_cmpi (I don't use WAD so much so I can't help you there).