Apparently, the loop needed a few more iterations for the delay to happen.
I found a new way to trigger the "bug", without requiring long lines.
If you run this with version 7.4.x =< 7.4.11 it will be slow:
https://3v4l.org/1n3Vh#v7.4.0
It already takes 1.5s as is.
If you change the "180" value in the second loop for something slightly higer, like 200, 300 etc you will reach timeout.
Apparently PHP 7.4.12 fixed it by updating to PCRE version 10.35, which fixed it by enabling JIT optimization.
I understand this behaviour is not intrinsic to HTMLawed, and I would understand if you left it as is. Anyway I'm experimenting with workarounds, like replacing newlines for tabs, and oddly enough it seems to work.