You should not modify any mojoPortal code.
Do some searching about implementing a custom HttpModule. You can compile it into your own dll and configure it in the httpmodules section of Web.config. From inside an HttpModule you can respond to Application_Start.
There are examples of various custom HttpModules in the Web/Components folder of the source code includin CultureHelpHttpModule.cs, AuthHandlerHttpModule, BannedIPBlockingHttpModule.cs
You would put yours in a custom class library project. You can discover how the above modules are plugged in by studying the Web.config and learn how to plug yours in similarly.
Hope it helps,