Well I assumed touch.gamma returns some angle (so up to 360 and down as -360) but I might be wrong.
Your best bet is to display the value touch.gamma to check how it works. (it's maybe only returning a 1 -1 range)
Every tick set your text to touch.gamma.
From there test it and understand the results/returned values.
Than adapt the checking of the value (if touch.gamma is in the range of certain values, it means the device is tilting to the right, other set of values tilting to the left, etc...)
The fact that toggling the test makes the actions executed means that this test never returns true. So there's something with the test itself and or it's values range.