Oh , I dug deep and found out I have to code in C++ and work with a file called signals.gs. So I am just looking over the code written and reading an old tutorial on how trainz used to handle their scripting . Although incomplete and somewhat dated ,it gives me a bit of an idea of how the infrastructure of a session rule is defined.