Found this thread while trying to solve high score issues for my new 4-player cab using MAME 171. So far, I have had no luck using this GIT. I tried running the hiscore.lua from the command line modifier inside Maximus Arcade (my frontend), as well as creating and modifying a mame.ini file (which didn't exist before I tried to solve this problem. I had to run mame64 -cc to make one) per your instructions.
All attempts to run the lua result in a thin white border around the screen, which remains for a few seconds, then disappears and leaves a black screen. Nothing else happens. My frontend is still active, as I can exit out of MAME and get back into Maximus.