You can remote debug any script you want with ZeroBrane. The script just has to have access to the mobdebug module and the lua sockets module. The screen scripts have the package.path and package.cpath already setup for this. Just do Operator->View Screen Script and look at the top of that code. Cut and paste as needed.
With ZeroBrane, you can now debug the screen scripts. However, they are running in the screen (not the editor). So to edit the code, one must exit out of the LUA editor and go back into the screen editor. That is just the way it is. Mainly because the scripts are compiled into one larger script. But also because they are compiled and there is no way that the LUA editor is going to be able to compile the changes and insert them into the running screen. It is why the ScreenScript.lua file is read only.
Also, when editing a screen script from the properties of the object, a LUA editor is launched to edit it. The script resides in the screen as a string. So the screen writes that script out to a temporary file (so that the editor can open it). The key thing here is that the screen launches the editor with a temporary file. How do we know when you are done editing that temporary file? Well... because you closed the editor. We can't tell that the editor closed the file, but we can tell if you closed the editor (because the Mach GUI opened it). Currently, there is no way in the ZeroBrane editor to tell the Mach GUI if the temporary file is close and furthermore, there is nothing inside the Mach GUI to listen if there was. Once the editor is closed, the screen compares the script in the temporary file to the string in the properties. If they are different, then screen replaces the string with what was in the temporary file. So leaving the editor open is not really an option.
Also note that if you try and open the screen LUA editor more than once, you will not succeed. It will raise the existing instance of the LUA editor. This is the default behavior of ZeroBrane Studio. However, that can be changed in the user configuration. Have a look at the ZeroBrane documentation on how to do this. But also note that there can only be one LUA editor with a debug server running. It uses TCP/IP ports in the background. But a solution to the problem may be evident here. Open the ZeroBrane editor from the GUI menu (this one will be the debug server). Then edit the screen. Each time you edit a script from an object property, a new editor will open. So that you can edit it (and more importantly, close the editor to pick up the changes). You'll just have to try it out. Keep in mind that editing the any of the screen property scripts will cause the screen to regenerate the ScreenScript.lua file. It only does this AFTER you exit the screen editor. So if the ScreenScript.lua file is open in the first ZeroBrane editor will be stale. The fix for that is to just close the ScreenScript.lua file before you exit the screen. But your breakpoints may be lost or moved.
All of this is why I outlined the way to debug the scripts in the manual like I did. It is a solid and fool proof method for getting the job done. It may have a lot of steps, but it has the desired results. At least you guys now have the capability of using a debugger in the screen scripts where as before it was a lot more cumbersome with message boxes and SetLastError (called printf debugging in the programming world).
But the easiest thing to do to make debugging easier is "don't mess up" in the first place, right? LOL
Steve