Note, this alters an official XML file, and so it should be placed in a hak to be used with a specific module only. It only fixes the issue for modders and their scripted modules and does not fix modules that have not used the scripting initially.
First, here is the script that goes on the container's OnInventory Disturbed:
And then here are the XML alterations to the Container.xml file:
(CLICK ON IMAGE TO ENLARGE VIEW TO READ - UPDATED 22/04/09)
I have highlighted the additions in yellow. NB: There is also a commented line in the XML code above the last yellow line to ensure it is not used instead. (Marked with an exclamation mark.)
My thanks go to Merecraft & Amraphael for the inspiration.