Since I am having trouble editing the first post, I've uploaded the script
here
Changelog
19/02/2011 - Added ability to detect and skip already done changes, so that you can run the script many times without messing up things
19/02/2011 - Added ability to optimize boot process
19/02/2011 - Added ability to detect sudoer status. It will only prompt if you are not in sudoers
19/02/2011 - Added virtualbox repo
19/02/2011 - Fixed some code