# getting the time of current setting and store to variable 'screenoff'
screenoff=$(gsettings get org.gnome.desktop.session idle-delay \
| awk '{print $2}')
# set "turn screen off" to never
gsettings set org.gnome.desktop.session idle-delay 0
echo "lots of important information being printed..."
# set back to the former setting:
gsettings set org.gnome.desktop.session idle-delay "$screenoff"

the value stored into $screenoff would of course get lost if the script was canceled before completion.

A workaround could be to store the value to a temporary file, which gets removed at the very end of the script: