It works with cvars which are 0/1 boolean values, and automagically changes it to whatever it currently isn't.
Code:
bind u "bindtoggle sv_cheats"
Each time you depress the button, the sv_cheats state should flip.
"Incrementvar" is also handy, taking min/max/step arguments like a little for-loop.
Code:
bind u "incrementvar mat_wireframe 0 3 1
Should cause mat_wireframe to increase by 1 for each press, with 0-3 being the min/max. When it goes past the max it loops back to the minimum.