It took me a while longer than expected, but I'm glad to report that the suggested solution is implemented and looks OK. I now use the EJB layer as a bytecode supplier and then creating classes using a custom classloader on the web tier. Since I only need to create implementations of a single interface this way, it's a very narrow use case and so far it seems to work just fine.
Thanks again for the hint!