There are some many things wrong with that code
1. $chan doesn't return anything with the on quit event
2. you called your alias /quit?
3. your using return if the channel is #chan1?
4. whats the $2 $3 $4 meant to return when you just calling /quit?
on ^*:quit:if ($nick ison #chan1) msg #chan2 $nick left irc ( $+ $1- $+ )