Thanks for this. I've got your file but didn't have time to check it out, so I couldn't confirm it works or something. Up to you.
The only important change I've made to bb_plugins.code, is this line:
if($user_id>'Admin')
This is wrong code. $user_id could only have integer value, and this condition will be always work. But for your add-on, you could plug this thing in only for users with allowed HTML, i.e. it could be Admin only. The condition should look like this:
if($user_id==1){
Here you may also
download the fixed version.