The extra alias is necessary to overcome a $wid bug. ($wid in ON CHAT always reports only the window ID of the first DCC CHAT window opened to $nick. So the alias allows the event to write text to the correct DCC CHAT window, even when you have more than one DCC CHAT window open to $nick.)
This is not so much a bug in $wid as it is a long-standing design issue that affects all commands and identifiers in remote events.
All remote events run with the
status window as the active
window eg. if you use /echo in the event, it will display in the
status window associated with that event. Only a small number of remote events, such as on INPUT, use the
window that triggered the event as the active
window.
I would love to change this so that all events are triggered using their associated
window as the active
window. However this would cause all existing scripts that expect the active
window to be the
status window to work differently ie. all commands and identifiers would now return results based on the chat
window and not the
status window. This would very likely introduce all kinds of subtle bugs and require many scripts to be updated.