On kick
From Scriptwiki
The on KICK event triggers when a user is kicked from a channel.
on <level>:KICK:<#[,#]>:<commands>
$knick is the nick that was kicked and $nick the nick that has kicked.
Note that if you want to rejoin automatically after a kick, you can turn this on in the mIRC options dialog. But remember that you normally haven't been kicked without reason and many people don't like autorejoin. Additionally, there is a mIRC option to keep channel windows open (when kicked).
Example
on *:KICK:#: { if ($knick == $me) { echo -s You have been kicked out of $chan $+ . } }
This example would trigger when you have been kicked out of a channe and echo it to your Status Window.
See Also
Take a look at the On ban event if you want to react on bans. Thus the On unban event reacts on unbans.