Looks like:

msg Q@CServe.quakenet.org AUTH $$?="username" $$?*="password"

will do the trick.

Put it in the quakenet-specific section of the perform options:
alt-o Connect->options [perform]
[x] Enable perform on connect
[Quakenet] (from the dropdown list - may need to [Add] it if it's not already there)
Then past the above in the editbox.

When you connect to quakenet, you will be asked for your username and password, then the auth request will be sent to Q.