Well done for the coma instead of the semicolon, I fixed it on my script, tried to run it and it still doesn't work without any error message or without something in the console. I wiped my autoexec.cfg 2 days ago and re-writed the script so here comes the error of the missing semicolon, too bad it's still not the problem. So, I tried your script that does the same actions with an echo, the echo works, then I have a double "could not set gamma" lines that appears in the same time, then it prints "test" in an inf-loop.
And about the error in the first script, I think it's the 180 that would not be executed since it tried to set the gamma to the value "180,".
EDIT: I tested with dyngamma 1 and I've set ofc_gamma_list first value to 300, launched ac_aqueous with bots (who were hax-jumping everywhere btw, wtf was that), it was bright, then the bug occured and it became dark, I checked the gamma value, theoretically 300. I still couldn't set the gamma to the real 300 without setting another gamma value (like 299) before.
And about the error in the first script, I think it's the 180 that would not be executed since it tried to set the gamma to the value "180,".
EDIT: I tested with dyngamma 1 and I've set ofc_gamma_list first value to 300, launched ac_aqueous with bots (who were hax-jumping everywhere btw, wtf was that), it was bright, then the bug occured and it became dark, I checked the gamma value, theoretically 300. I still couldn't set the gamma to the real 300 without setting another gamma value (like 299) before.