Snippet as enable condition

I tried this as before as well. However, I get - Uncaught SyntaxError: Illegal return statement