The AssemblyBuilder looked promesing but as i understode the use of it is to add scripts to the assembly that are outside the asset folder. So you have to create an AssemblyBuilder, give it a path and an array of scripts.
Will look further into EditorCompilation class, but my main question for that one is how to get a reference to it?