You can code your app in whatever scripting language you want, but it can't download and execute code arbitrarily. For example, the unity game engine for iPhone uses mono & C#/javascript for all it's game programming/scripting. But when you use the app, the app doesn't act as a player but as a standalone application.