Yeah FWIW I do the same things with Swift scripts - I have a load of helper functions I just copy into every script, mainly to make shelling out to external processes easier.
Here's the GSOC pitch which I think is what I was thinking of but that might help solve the same problem of pulling in external files/modules from a top level Swift file (script or manifest)