Rob this is what I have so far. It's possible that in the back and forth I'm doing I've either missed noting a change or done unnecessary steps etc. Builds and compiles are still a thing that I'm not understanding to my satisfaction.
I will at some point recreate the original file and do a diff between it and what I'm running.
My build has been for a while stalling the box during the build of kstars so I'm still working away.
kstars seemed to be failing earlier on because of the dependency of stellarsolver on the qt5 pieces. I tried installing stellarsolver and later added the qt installs, kstars seems to get further but then began hitting the lock up issue.
zram service is failing but I've not looked into that yet.
I was seeing errors at one point when I reran the script with a permission error

I'm kicking off setupDebianSBC.sh from a wrapper script and think I'm capturing all the output to a log (happy to take advice if there is a better way of doing that).
sudo ./setupDebianSBC.sh 2>&1 | tee setupDebianSBC.log

I've added the following into my local copy at about line 60 to install items that appear to have shown up as missing (and included notes where changes have been made elsewhere). Some may have been optional but I'm trying to be able to build as much as possible.
BTW I also added an " @ $(date)" into the display routine to help me identify when things have really locked up.
#########################################################
############# My Addons
display "Running Bob Stephens add ons."
# libwxgtk3.0-dev has been renamed to libwxgtk3.0-gtk3-dev (PHD2 install)
# askubuntu.com/questions/1241217/package-...date-on-ubuntu-20-04
# Changed the call from git to https at git clone anongit.kde.org/kstars
# installs that didn't look like they needed to be done in place.
sudo apt -y install libkf5doctools-dev libkf5texteditor-dev libkf5kdelibs4support-dev
sudo apt -y install kdoctools5
sudo apt -y install libgtest-dev
sudo apt -y install libgmock-dev
sudo apt -y install oggfwd
sudo apt -y install libtheora-dev
# qt is used by the stellarsolver install and had issues in this build
sudo apt install qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools

Read More...