Very difficult to answer from only this small piece of code, but try the following:
To include your script, use 'require_once' instead of 'include'. Put all logic of your script into a function. Return the value of $moderate like with the following in the end of your new function:
PHP Code:
return eval('$moderate = "' . fetch_template('navbar_moderation') . '";');
Then in your plugin call that function with:
PHP Code:
$moderate = my_function();
PS I haven't finished my coffee, so the above will be full of errors.