I wrote a similar script way before fail2ban was ever created in around 2003 or so. When PF was first introduced. Since then I've just kept using it since it works particularly well for what I want it to do.
Yeah, I've written a number of very long, very gruelling scripts that ultimately were all replaced by denyhosts.
On the flip side, denyhosts only works on sshd (to my knowledge) -- so the scripts I wrote to monitor tornado log files and block all the random attack vectors is still worth having around.
denyhosts is configurable enough that I see no reason why it couldn't also work for other services. You'd probably have to hand-configure it (with a regex for each log type), though.
That said, I've only ever used it for ssh.
I actually have a home-made script similar to fail2ban.