Ok, understandable. So this script of yours is what alerts you to the fact the home has been "cleared." It pops up the warning that you are no longer homed. I wouldn't use the term "losing home" because that has a very distinct and physical cause.
So, good news, bad news; Good news is its software, not hardware. Bad news is its software, not hardware.
It sounds like you would want to file a ticket with Machsupport. I can offer up some advice but having them look at your script (I have my last penny riding on something in that script is clearing home on accident, welcome to my hell!) would be a lot quicker. File a ticket and they will get around to talking to you in less than 48 hours. As of late they have been real responsive to me. They have more knowledge about known bugs and quirks in the scripting engine than I would.
Best of luck though. Lua is a pain in the rump!