You have 3 porblems here
(1) DEBUG is inbuilt a command so if you have created a ALIAS DEBUG, then your never even calling the internal DEBUG command, your calling the alias.
(2) You can not call ALIAS DEBUG as an $identifier, becuase unlike problem one calling a alias thats replacement of an internal command you cant replace internal $identifiers
(3) The debug line is ment to have the name of the $identifier you want to use, but not using the $ becuase then mirc actually attempts to evaluate that $identifers


on 1:connect:{ debug -i @debug debugalias }
alias debugalias {
; $1 ( not $1- ) contains the whole line of debug info
return $1
}