Re: replacing page title
The problem with your code was that you were adding a filter to bb_title via an action run when the title was already written to the browser. You should have added the filter at bb_init or just left it on it’s own in the plugin.
Also, I don’t think there is particularly a need to remove the existing filter on bb_title in your case.