This is a python script that works in conjunction with a workflow (you need Workflow for ios) to open script and save it to Pythonista.
Please use this workflow link with the latest version of the code, as the way we grab the file contents changed a little: https://workflow.is/workflows/2102d6b710844244bcc22742e860b62c
For posterity, the old workflow link is: https://workflow.is/workflows/8cdee57f79664205a6a565c9cbdb3d48
An interesting modification of this script can be found on this gist: https://gist.github.com/ScottSmith95/2f9b249f9e6e0e9fc6ef
Finally, this forum post contains a lot of very enthusiastic modifications to this script, some of which take advantage of newer features in Pythonista: https://forum.omz-software.com/topic/1788/save-script-via-open-in-directly-to-pythonista/10