Any particular reason you wouldn't use App_Code or App_OldCode? If you don't, you have to reference all the Kentico DLLs in order to make anything build, then you have to add that DLL to your Kentico solution.
Is it possible to try things the other way around and have your needed code in Kentico to publish in the event handler but it is triggered by an outside source (library, web service, etc)