Correct - that is the reason you can't use /say and /me in such events.
How, exactly, you handle this will depend on the event. For the on TEXT and ACTION (and to some extent, NOTICE) events, you can use:
$gettok($chan(#).hwnd $query($nick).hwnd $window(Message Window).hwnd,1,32)
within the event to return the handle of either the channel, query window, or dedicated message window, depending.