yes, sadly you still have to press "ok". but you can use the pythonista:// url scheme to run a script, with arguments.
I used this for a while to run a script that logged into my library, web scraped the list of upcoming renewals, then renewed all books that were due within 3 days, then set a new notification based on the next books due (which launched the renew script).
@Phuket2 you can create your own action menu item which does what you say. I have an action menu to run a script in the same interpreter ( without clearing globals) because i find that easier for debugging. You could add some lines before/after the execfile.
# execute script in editor, in current interpreter session without clearing globals
does work, though of course exceptions in threads are not catchable like this. i also use pdb.settrace in my code where i want to trigger the debugger.
an idea i have had, but never worked on seriously, would be to subclass Pdb/Bdb to incorporate more of a visual debugger. for instance keeping the editor line in sync with the current debug line, watchlists, etc. I played around a little using codemirror inside a webview which allows things like setting of breakpoints, line highlighting, etc.
I had a look ar the PyNewInterpreter API. It might be a way to create threads that have a little bit more privacy than the current ones. It appears that I cannot use the API via ctypes (because that would mean that in interpreter thread needs to manipulate itself). But I think that some Pythonista-provided functionality would be possible.
Please consider this for a future release (or convince Apple to allow sub-processes in iOS - whichever is easier for you ;-) )