You can have those three events combined using $event and $iif to shorten a bit and get rid of repetitions:
on *:nick: copy_
on *:text:*:*: copy_ $1-
on *:action:*:*: copy_ $1-
alias -l copy_ {
if ($event == nick) && ($nick == %copynick) set %copynick $newnick
else $iif(%copy == on && $nick == %copynick,$iif($event = text,msg,describe)) $iif(#,#,$nick) $1-
}
This is just an example.