One parts chans, but quits the entire network - there is no $chan and thats why there is no way arround "while ($comchan,Nick,N)".
I do not know what "alias e.part" returns; simply dont use it, and try:
on ^*:QUIT:{
var %i = 1
while ($comchan($nick, %i)) {
echo -bfrt $v1 15 $address($nick,5) 14 has quit4: ( $+ $1- $+ ) $ts2
}
haltdef
}