In Sitefinity 4.0 we use ASP.NET Routing
All page requests are processed by PageRouteHandler
, so you can implement a custom handler that inherits from it and inject your logic.
We also use inversion of control, so this is the other option to executed some custom code. This could be done through ObjectFactory class and its methods
the Telerik team