You'll want to open the Wiremod tab, select the Expression 2 tool, and then you can write your own code—believed to use a visual C-style language.