I haven't touched the script. Instead, I renamed the original "lock.mdl", then copied a different model from the project, renamed the copy to "lock.mdl", then started the script.
Sometimes it crashed, sometimes it didn't.
I believe now, though I don't remember it 100% anymore, that it crashed with two models: The original "lock.mdl", as well as a different MDL5-version of it, and a model of a treasure chest that is in the game. These are the only models I've touched with MED since I've done a reinstall of Windows on this computer.
Other models, both from my projects, as well as a testmodel from the forum, did not trigger a crash*
I wouldn't use the seemingly problematic lock model at all anymore until I'm sure it is the reason.
I'm not sure I understood what you mean - I'm assuming the "lock.mdl"-model is the reason, but I've now replaced it by loading the original 3DS-data (the model was made in Wings3D), and saving that as a MDL. So the original faulty model isn't used at all anymore.
*
- I've tried running the thing several times per model, since the crash only appears semi-regulary. However, at the time, it crashed every time with the models mentioned.