[SOLVED]How does a dimmer work?

This looks better, I can see you are trying now. The error is because item needs no be capitalized: Item.
Then there’s some other small errors:

rule "apertura1"

when 

Item LivingRoom_Light1 changed to ON

then 

var x = (apertura.state * 24)
 Thread::sleep(x)
LivingRoom_Light1.sendCommand(OFF)
end

However, using Thread::sleep for long periods of time (>1 second) is a bad idea because it can block other rules from running, see here for more info. Instead use a timer

rule "apertura1"

when 

Item LivingRoom_Light1 changed to ON

then 

var x = (apertura.state * 24)
 createTimer(now.plusSeconds(x)) [|
LivingRoom_Light1.sendCommand(OFF)
]
end

It has the same result, but is safer to use.

I can’t guarantee everything is correct, typing on my phone and cannot test the rules.