You can technically use the entry added to the highlight section with your script:
$highlight(text) will return something if text is matching any entry in the highlight section.
There is one problem with this, it's if you happen to have entries being numbers. Indeed $highlight(0) returns the number of entries in the highlight section, it doesn't check if '0' matches any of these entries.
So the solution is pretty simple:
on *:text:*:#channelforhighlight:{
if ($1- !isnum) && ($highlight($1-) != $null) {
echo $chan you're getting highlighted!!
}
}
Note that 100% working code is possible but require much more code, the above is a simple solution working in almost all cases, see
https://forums.mirc.com/ubbthreads.php/ubb/showflat/Number/189847 and
https://forums.mirc.com/ubbthreads.php?ubb=showflat&Number=196007&page=0#Post196007