Hmm! Yeah, my example in the book only goes one way... I'll have to think about adjusting it.
But for now I'll explain some other ways to write that script here!

Because buttons can hold a binary value (0 or 1) you can set it to hold either of those values directly.
Or you can tell it to be "NOT the current value". This will toggle it between 0 and 1 depending on which value is currently stored.
"!" is the Lil operator for "NOT" so it could be written like this:
on click do
thebox.value: ! thebox.value
end
I hope this makes sense? And thank you very much for reading! I'm always happy to clarify things!