Get underlying Dynamo script code to use in visual studio

Hello, I have many working Dynamo scripts which I would like to add as a Revit plugin. I am wondering if there is some way to extract the code which is created in Dynamo so that it could be used to build a plugin. When I open the .dyn file it is in json. Anyone have any insight into how this is compiled into something which runs on the .NET framework (I read Dynamo runs on .NET)?

Dynamo code is open sourced here if you want to read it all and understand it

I would just tell you to convert everything you have done in dynamo as revit methods and principles to then use that as your code for revit button etc