Yessir, Add these lines to the script where you need it to close:
Simba Code:
MoveMouse(x, y); //x, y would be the coordinates of the x button to close shop
Wait(50, 200); //Wait between 1/20 and 1/5 of a second so you don't click too fast
ClickMouse(x, y, 1); //Use the same x and y coordinates as MoveMouse
Also .. I briefly looked at the script and around line 22, I noticed a boolean names closeinterface that was False by default to prevent the script from repeatedly trying to close it. I didn't check much furthere to see where it would be used, but you could try setting this to True.
If you are pretty new to Simba, Pascal, or programming in general, you can find some really great guides on these forums. Check out this beginner tutotial. It covers everything you need to know to write/modify scripts. It's very basic and easy to follow.
https://villavu.com/forum/showthread.php?t=118229
Good luck!