I think this must be the simplest/quickest way, with a new project and two files -xx.py and yy.py- on the same directory (xx has
import rhinoscriptsyntax as rs, yy random code).
If you open xx on the python editor, as you add/type
import yy appears as an autocomplete option. But with enter, autocomplete stops working. If you run the script then autocomplete comes back but only if the script could run without errors.
Also, if you have xx as a read only file then nothing happens (so autocomplete doesn’t return), perhaps a read-only error/reminder message would be useful here. Not sure how much of all this is intentional, what perhaps gives a misleading impression is that with a new untitled script you can execute code without (the user at least) saving to a file, so you don’t initially expect the saving/read-only situation.