A datarule in the platform (an Event) will always be a value of 0 or 1. In Lua scripts - if you compare a 0 or 1 number value to true or false, it will always be false.
Here is a script that waits on a datarule value change.
local timeout = alias['timeout'] -- assumes you have a datarule (event) with alias timeout.
while true do
local ts = timeout.wait() --triggers when datarule changes state
local event_state = timeout[ts] --gets the value at this timestamp of the event/datarule
if event_state == 0 then
-- do something
-- do something else, making assumption that a datarule is always 0 or 1.