Hi Spyridon,
I had a similar issue in a recent script I created for adding classifications in MM01. I ended up solving this by setting the solution property "Renew session after [n] transactions" to the value of "1" in an effort to "slow the script down" when it is running.

Give it a try, hope that helps!
------------------------------
Knavis McGowan | Master Data Specialist
ABBOTT RAPID DX INTERNATIONAL LIMITED | (321) 277-1499
------------------------------