At one point in time the TOS prohibited custom script engines like Lau. But, Apple (likely to cater to some of the large game companies on iOS) eased back that restriction 1 or 2 years ago.
I believe that downloading scripts/code and allowing users to enter scripts may still prohibited.
Users can enter scripts. And I believe you can even transfer scripts using the iTunes file transfer functionality. You just can't download them over the internet.
I believe that downloading scripts/code and allowing users to enter scripts may still prohibited.