In the documentation for $chan it says for .status:

The status property returns the value joining, joined, or kicked.

However it does NOT state the status of parted or parting. "Parted" when the channel windows remain open after parting (or being kicked), is possible. "Parting" when the part command has been sent but the PART protocol has not been received, yet. I don't know if "parting" has been implemented however
if ($chan($chan).status == parted) { works. }

. : Machine-Gun script named Bauderr with : .