Thanks for sharing the context.
You could have a
look at lua, a scripting language that has been ported by Iņigo. He also posted some examples. (Carefully read the installation instructions.)
You can also have a look at zenity, that is
part of the base-package of Iņigo. It allows to show dialogs from a shell-script. I use it for the installation of
MackxPatch, so see _apply.sh.