This could be a nice alternative to LlamaLab Automate [1], which is really useful for automating UI things on Android. That one is flowchart based, sort of like Scratch.
Theoretically one could write a scripting language for it, but it stores its programs in a proprietary binary format and the parser class is too hairy for me to reverse engineer. (the decompiler in jadx only gives you smali for most of it, control flow is too complex)