Depending on the database in use, you could implement a stored procedure of some sort. I know SQL Server 2000 (Microsoft) and Postgresql can do that. It could be triggered when an insert on a table of your choice happens.
It will check a value (say the user id of the owner of the post in your SQL uery is a certain number) then skip the insert.
It might be costly in terms of memory with the database. If the table is huge the query might take a /little/ bit longer than usual.
SQL Server 2000:
http://www.15seconds.com/issue/000817.htm
Postgresql:
http://www.postgresql.org/docs/8.0/static/plpgsql.html
Two pages of many, many websites dedicated to both servers. Look around. =)
That's not to say you couldn't change your PHP code, then run a UNIX/Windows diff (as in difference) utility to create a file that you can merge back into an upgraded phpBB software installation.
http://www.gnu.org/software/diffutils/diffutils.html