[SELECT ALL] Code:
bind KEY [altaction_5]
Press and hold to bring up the sniper rifle scope (must be using the sniper rifle obviously), release to unscope. It could be changed to a toggle, press to bring it up, press again to unscope. Depends on your preference really.