2
$this->template->assign( 'xoops_module_header', $this->renderMetas( null, true ) . "n" . $header );
$xoTheme->addScript(), are just shortcuts. They are rendered and appended to xoops_module_header. You should use this method inside blocks because modules, some of them, overwrite xoops_module_header.
This problem was not addressed but it is 'documented' in code:
// We assume no overlap between $xoopsOption['xoops_module_header'] and $this->template->get_template_vars( 'xoops_module_header' ) ?
$header = empty($xoopsOption['xoops_module_header']) ? $this->template->get_template_vars( 'xoops_module_header' ) : $xoopsOption['xoops_module_header'];