Solution
Global variables, to which a value in a DIAdem Python script is assigned, retain that value even after the script ends. A similar behavior occurs when importing Python modules with the import command. After you have imported a module, Python in DIAdem does not automatically detect when the module changes unless you reload it with importlib.reload.
For example:
import MySub
import importlib
importlib.reload(MySub).