Truth to be told, I'll write down your name on a scrap of paper so to never ever run anything written by you. No offense, but I don't want my phone to fry 'cause you're learning how to fry phones.
Having said that, I'll give you some hints, so that maybe in the future I'll try one of your apps (not going to happen).
1. If you want to write an Android app, it has to run Java, not shell code. If you want to write a shell script, write a shell script. This isn't bashing, it's a hearted hint. Trust me here!
2. If you still want to wrap an Android app around a shell script, then at the very least use Android/Java as much as possible and restrict the shell part to the strictly least required: special commands or commands requiring root!
Code:*snip*
What should you do? You should use Java (with proper try/catch blocks) checking for errors at each step you take, taking care of the possible failures (download not available, directory not existing, ...). Taking care of errors with shell code is possible but it's a PITA and you can't debug it with the debugger. Why am I even pointing this out in the first place?!? Just do it.
1. You can create the directory with Java. Not only that, but you don't need to hardcode "/sdcard" in it! Just use the API to get the correct path: http://developer.android.com/guide/topics/data/data-storage.html#filesExternal
2. You can downlad your remote file with Java. In the worst case scenario, you can use an HttpURLConnection + FileOutputStream. In the best case scenario there's an Android API for that.
3. You can unzip your remote file with Java, checking that all the files you expect it to contain are there and it got transferred correctly. Check this out: http://developer.android.com/reference/java/util/zip/ZipFile.html
4. You can delete the files you downloaded with Java. This is so easy I want to cry. http://developer.android.com/reference/java/io/File.html#delete()
5. The few commands you need root to run, and you need them to be shell scripts (you can't run Java stuff as root as far as I've harshly found out), you write them this way:
Code:*snip*
Pay attention and don't forget the "\n" at the end of each command.
This will make your app SuperUser.apk friendly and will get you to the result you wanted.
Hope you don't mind if I use this, but I needed a quick and dirty way for me to issue commands progmatically on an app I cobbled up to fix issues with my phone. And don't worry, I do have an idea of what the code does so as not to give the impression that I'm merely pasting yours into my app.