That's not a bad solution. I would ask that $dqwindow outside of PRIVMSG events returns $true/$false for the user preference of /dqwindow being on or off, since there is no reference to this. But then I don't know if those two should overlap.
Up to you.