I'm also interested in transferring code from Pythonista into something else and back. Something else is in my case a GitHUB or GitLAB server, which is already built-in to Raspbian. So far I was searching but haven't yet found a way to e.g. get Python projects from GitHUB into Pythonista and back, using the App Working Copy. Using the share function in Working Copy does not provide enough writing rights for Pythonista to copy files into the working directory. It also seems that Pythonista lacks a good way for integrating a source code management system.
You may consider using Node-Red on the Raspberry. It is made to turn the lights on and off and has a built-in GUI capabilities with excellent graphical programming possibilities. The Node-Red server runs under Raspbian and the programming is done in a Webbrowser, either on the Raspberry itself or via LAN or WLAN too. A Node-Red program consists of a wiring panel with debugging and configuration tools and a GUI with a slightly different URL. You may even call Python code or system commands from Node-Red programs.