Since events dont happen untill the currently running script completes, these events would no occur straight away, should they occur straight away, I see nothing they do here, that would lead me to believe it couldnt be done using a filter -k and a command following it (to do the $fevent == filtered section), should there be a large number of filters to do in your script, and thus reproduction of the same following command over and over, then filter and following command could be grouped into an alias and called from the script.
alias filter_flag {
filter $1-
if ($filtered) { echo -a finished filtering - $filtered }
:error
}
your script contains the commands such as filter_flag -fk file.txt somealiasname *fred*
* please note i havent tested any of that, but i dont see a logical problem.