My understanding is that what's banned on iOS is not arbitrary code per se, it's arbitrary code downloaded from the internet. Code you enter yourself, like in Pythonista, is just fine.
Isn't the problem JITing? Mozilla could ship Firefox, even with the JS engine, it would simply be unusable (compared to Safari) because they wouldn't be allowed to run JIT (only interpreter).