Sorry - yeah, I might be wrong. After reading your OP I should have asked, what template are you putting $headerinclude and $footerinclude in? I guess I was assuming that it was the header, navbar, and/or footer templates.
ETA: ...but assuming I guessed right and you
are using the "header" and "footer" templates, what I was suggesting is that instead of inserting $headerinclude and $footerinclude in the templates, change it to something like <!-- Custom Header -->, etc. Then move your plugin to global_setup_complete (where the header and footer templates will have already been processed and the $notifications array created), and add this to the end of your plugin code:
Code:
$header = str_replace('<!-- Custom Header -->', $headerinclude, $header);
$footer = str_replace('<!-- Custom Footer -->', $footerinclude, $footer);
Also, I think the way you have things set up, on your custom pages your header and footer php files will be read in the plugin and then again in your page code, so for efficiency you could surround the plugin code by an "if" statement that checks THIS_SCRIPT and doesn't do the include if it's your custom script.
(BTW, I haven't tried this code).