How can I successfully run this script on a emulated terminal on Android?
You must install busybox on your device. And you need a kernel with loopdevice support. I use a 2.6.35.7 Kernel and I can run Debian. You may have a ARMv6 CPU Then Ubuntu doesn't work.