Arithmetic Gates, i am stuck

Hello, could somebody help me?
I suck at some LUA commands
I tryed to make a gate for processing Stargate’s iris with imputs:
and outputs:

The gate should do this:

After %start% recieves 1, it sets %iris% to 0 and countdowns in seconds from %time% to 0, after it reaches 0 it sets %iris% again on 0

I am stuck at this code xD

GateActions[""] = {
	name = "",
	inputs = { "", },
	output = function(gate, )

It should be a private (for myself) expansion of