This was loosened in June 2017. Now apps can can download and run any interpreted code, using any interpreter. It’s not restricted to coding apps or user-written code.
In the developer agreement, the second paragraph of section 3.3.2 gives special permission to programming environments, but that’s for executable code, which won’t work on iOS anyway.
So, it doesn't make any sense for Apple to not allow 3rd party browsers apart from its intention for a walled garden even if it means compromising security for its users.