You can get some ideas. I have done ussd codes through at commands many years ago. It is generally a pain to make scripts for each command, bun once done it works.
If you need some inspiration you can look here https://nethelpforums.net/viewtopic.php?t=153
It is 10 year old, written for Openwrt, and for different mobile operator but some at commands will never change. Use google translate, and ipk is just a tar archive (you need the source, ignore pretty much everything else)