Well since you recently saved your brick, try to avoid a new one and just build a default image with the online image builder having the default packages but only the following test commands in the script to see if/how the script may work. As in if it needs extra shebang/exit0 stuff.
echo "just a simple echo test" > /etc/echotest.txt
mkdir /etc/blablabla
touch /etc/blablabla/testfile
date > /etc/blablabla/datescript.txt
date >> /etc/echotest.txt #puts date at the last line in file
Than step by step try to add your new default config with uci commands
(verified before in a clean image using ssh) in this custom script.
You might also try to remove all packages you don't like from the current default image and see if that still boots, than later adjust the package list for the online image builder.