Yeah, it's a fairly-well known side effect of using background scripts. My solution for it is to add this to the script, somewhere before 4tpy:
;;;
;;; --- Forced shutdown ---
;;;
;;; Press 'Esc' on the campaign map, then click on the '?' button in the
;;; menu scroll to terminate the script.
;;;
;;; When would this be useful? -- When you are already in a game and
;;; exit back to the main menu to restart the campaign, or reload a saved
;;; game, RTW does not automatically terminate the script, so you have
;;; to do it yourself. If you leave the old script running, you'll have all
;;; sorts of weird problems with the script in the new game.
;;;
monitor_event ScrollAdviceRequested ScrollAdviceRequested end_game_scroll
terminate_script
end_monitor