Those are extremeley limited and I don't think it's possible to run any kind of interesting scripts locally.
I did look at it when I still had an iPhone and it's one of those "almost usable but fundamentally broken" things that are par for iOS. It works well enough that I could spend a weekend or two making stuff that almost works with it.
Jailbroken devices have this ability. At one point I had rclone daemon syncing iCloud files to Seafile through the terminal. You can also run scripts through Shortcuts by local ssh
I did look at it when I still had an iPhone and it's one of those "almost usable but fundamentally broken" things that are par for iOS. It works well enough that I could spend a weekend or two making stuff that almost works with it.