You probably want to check if ($knick == $me), instead of ($opnick == $me). Adazh's unspoken suggestions (/join #tbmonly, and the /timers on the commands) are probably good too.