I understand what you are wanting to accomplish, but, IMO, this is not really a boot script, rather a question of how to automate updates.
I would configure automatic updates either in synatpic (graphical) or with unattended-upgrades (command line).
You may need to install synaptic
sudo apt-get install synaptic
Then configure automatic updates under the Updates tab
If you want it to automatically install these updates without notifying you, check
Install security updates without confirmation option. I believe this will install all updates from all repositories you have selected, and not just security only (it did last I looked).
To do this from the command line, install
sudo apt-get install unattended-upgrades
unattended-upgrades is intended for security updates on servers, but can be configured to your needs
# command line
sudo -e /etc/apt/apt.conf.d/50unattended-upgrades
gksu gedit /etc/apt/apt.conf.d/50unattended-upgrades
And add in the repositories you want to use for your upgrades.
For details see Ubuntu Server Guide Unattended Upgrades
When using your machine, if you find a bug, confirm you are up to date and search for duplicate bug reports as advised above.