A basic set of events would look like this:
on *:QUIT: if ($nick == Wallfly[BZZZ]) enablescriptcommand
on *:PART:#channelname: if ($nick == Wallfly[BZZZ]) enablescriptcommand
on *:KICK:#channelname: if ($knick == Wallfly[BZZZ]) enablescriptcommand
on *:JOIN:#channelname: if ($nick == Wallfly[BZZZ]) disablescriptcommand
Perhaps it's better to use $address($nick,n) (see /help $mask for a list of n-values) though instead of $nick since the bot's nick can change.