I had some trouble with the accepted answer as I'm not hugely familiar with shell scripting on Android/Unix/Linux so I thought I'd add my experience here for anyone in a similar boat.
To get this working with Tasker or similar the line you need is:
echo 0 > /sys/class/leds/lcd-backlight/brightness
For tasker put this in the 'command' field with 'Use Root' enabled, works like a charm. To disable simply switch the zero out for a 1, ergo:
echo 1 > /sys/class/leds/lcd-backlight/brightness
or lock and unlock the device.
So to answer your question about quickly toggling this behavior. Assign each of the above commands to a tasker task, then you can make use of the new long-press intercept in the latest tasker version to toggle the screen on and off without putting the device to sleep. Alternatively you can assign the command to a profile which triggers when your conditions are met.