I'm glad it helped you.
I also tried to use disable_ui with no luck. Thank you for sharing your new version because it was exactly what I was trying to achieve the first time, and your solution will still be useful for our mod.