If the mode(s) that you are applying are not being kept, try checking with chanserv to see what (if any) modes are locked using mlock.
If the mode(s) that you are trying to set are being countered by chanserv's mlock, then you need to find out who has access to change the mlock options on chanserv for the channel in question.

That's the only thing I can think of that would keep the code you posted from working.