Well..I don't know about iPad. But there's an App on the Android market called Terminal IDE that lets you do programming using Vim right inside your device. It even come bundled with Android SDK.
"Yo dawg, I heard you like to program Android. So I put an IDE in your Android so you can program Android while you're using Android!"
Why don't you write an offline Javascript app to do it? Use one of the javascript syntax highlighters for the editor, the localstorage api to save, eval() to run, etc.
There's an iPod/iPhone app called jsAnywhere that's free and I like it. You can create projects, have an HTML, CSS and JS file, and run it. Might not have an iPad version.
"Yo dawg, I heard you like to program Android. So I put an IDE in your Android so you can program Android while you're using Android!"