have you checked examples of partial routing in Episerver? This might give you some ideas and right direction.
There are a few nice getting-started blogposts by Jon:
(and a few more down in the suggested links)
This sounds like a good fit for a partail router as Valdis mentioned.
I am trying to create a proof of concpet where I want to create a virtual route e.g /blog/category/blog123. Where blog123 doesnt exist as page in EPiserver. So isntead of getting 404 page i want to pick the url and search for any blog post that is tagged with blog123 and show the page under the url /blog/category/blog123 (the canonical url will prevent the duplicate content). If no tagged blog will found then show 404 page.
The path to the virtual url could be any thing like /abc/def/blog/category/categoy2/blog123
/blog/category/myblog page might exist as a page in Episerver and the page should show as normal.
The only conistant thing is the url will always contains the /blog/ path