I'm not sure if you are still active, but your user script had numerous problems relating to deprecated APIs - namely addPortletLink (now mw.util.addPortletLink), wgNamespaceNumber (now mw.config.get('wgNamespaceNumber'), wgAction and other wg prefixed variables.
Feel free to undo my edit and address these problems at your leisure.