Martin, see if this gives you what you need or at least gives you something that you can build on for your own particular requirements.
The same principle as for Shortcuts is used in that it will dynamically create a web page which you then bookmark to the home screen.
I’ve built in a little menu that allows you to just enter the name of your scriptable script or alternatively, specify a name and any custom URL you choose. You could extend this to cover whatever typical URL schemes you like (e.g. Pythonista, Drafts 5).
After getting those text based details, you then get prompted for an icon. I’ve added some example ones in as a standard set, and also an option to specify a URL for your own icon. The standard set can be modified however you wish, it is just a list of URLs.
Once the details are captured, it builds and loads a custom page in Safari, and then you can go from there for saving it to the home screen.
I’m positive you could do the same thing in Scriptable too, but I already had the basis for this in Shortcuts, so it seemed the most expedient way to give you an example approach.
Hope that helps.