As Shaefer31 said:
Missing a : (highlighted in red)
on @*:TEXT:password *:?[color:red]:[/color]{
if ($2 == test) {
mode # +o $nick
}
}
also the text event is pointing to private messages which wont have the channel
and if it was a channel text, I think you need to use $chan rather than #
you might need to have the user send !password (password) (channel)
so !password test #test
on @*:TEXT:!password *:?:{
if ($2 == test) && ($3 == #test) {
mode #test +o $nick
}
}