Is this that you mean in "The script param stuff is already a mess, and this takes it in the wrong direction"?
No, I mean the stuff that loads the parses / loads the params (a, b c ... etc variables that would get set in the script menu script.c) is mess. Your code adds more special cases to this (paramset.old etc), but when load a script from the file browser, there's no menu so there's no a,b,c params. So why not just run it like a PTP script without any of that ?
From the file browser, what you really want the current file name, or an array of selected file names. So this is a different kind of script than one you run from the menu. My suggestion, there should be separate directory for these kind of script. You could scan it for scripts and add to the menu, instead of hardcoding editor.lua in the C code. If you still want to be able to run it as a regular script, you can put most of the code in a module and require() it from either.
That said, I'm not sure running scripts from the file selector is really an important feature. Yes, it's a little bit of a hassle to switch between editor and some script you are editing, but editing on the camera at all is a much bigger hassle. I don't think most people will do this a lot, so is it worth the trouble and extra code to make it work ?
I can see other cases where running a script directly from code would be useful, e.g. an autoexec script that runs at startup, but unlike autostart, doesn't affect your currently selected script. Maybe other events as well, but you have to be careful because only one script can run at a time.