I experiment with regex and regsubex to emulate your code the same way and has been a success:
on $*:text:/^(lol|rofl|brb|h(i|ello)|away|Im back)$/iS:#: {
if (!%f) { inc -z %f 5 | .msg # 2,11 $nick $regsubex($1,/(.+)/iS,$iif($regml(1) = lol, is LAUGHING OUT LOUD,$&
$iif($regml(1) = rofl, is ROLLING ON THE FLOOR LAUGHING,$iif($regml(1) = brb, will BE RIGHT BACK in a mooment,$&
$iif($regml(1) = hi, Hello,$iif($regml(1) = hello, Hi,$iif($regml(1) = away,is currently AWAY and will be back in a moment,$&
$iif($regml(1) = Im back, $nick is BACK from being away or BRB)))))))) }
}
Your script needs to have a trigger flood protection in case somebody spams it.