Intergas Incomfort Lan2RF rules

Is it posiible to set the timer there without anything inside so the while-loop has to wait one cycle of the timer before it can proceed? Almost like the sleep-thing?
I am trying this now without errors, but I think the rule 'hangs’on this.

timer = createTimer(now.plusSeconds(30)) [|
                    data = sendHttpGetRequest("http://192.168.0.6/data.json?heater=0&setpoint="+setp+"&thermostat=0%C3%97") //resend untill succes
                ]

And locking aint working for me yet either. I tryed the syntax from here:

val ReentrantLock thermostatLock = new ReentrantLock
 try {
            thermostatLock.lock()  //Make sure no new setpoints are received through http-binding in other rule
            logInfo("Update Thermostat SP", "step 1 setpoint sent: "+setp+"°C, this means: "+twish+"°C" )
            do {
                data = sendHttpGetRequest("http://192.168.0.6/data.json?heater=0&setpoint="+setp+"&thermostat=0%C3%97") //resend untill succes
                WK_room_temp_set_1_lsb.sendCommand(transform("JSONPATH","$.room_temp_set_1_lsb", data)) //put in item to get string to number
                WK_room_temp_set_1_msb.sendCommand(transform("JSONPATH","$.room_temp_set_1_msb", data))
                val lsb = WK_room_temp_set_1_lsb.state as Number
                val msb = WK_room_temp_set_1_msb.state as Number
                celsius = (lsb + msb *256) / 100
                Thread::sleep(15000) //wait 30 seconds before resending setpoint and get new data
                logInfo("Update Thermostat SP", "step x setpoint in thermostat: "+celsius+"°C, should be: "+twish+"°C" )       
            } while (twish != celsius)
            T_WK_SP_block1.sendCommand(OFF)
            logInfo("Update Thermostat SP", "step 5: Finnished!")
         }
         catch(Throwable t) {
            logError("Error", "Some bad stuff happened in my rule: " + T.toString)
         } 
        finally {
        thermostatLock.unlock()
        }

This is the error I receive:
Rule ‘Update Thermostat SP from openhab’: ‘lock’ is not a member of ‘null’; line 142, column 13, length 21
Which is the line with thermostatLock.lock()