To quickly wrap a code block in useful constructs, select it in the editor, press &shortcut:SurroundWith; (Code | Surround With) and choose the desired code block, e.g. if.
The list of available options ("wrappers") is context-sensitive and depends on the language that you are currently using. For example, you can surround html blocks with tags, etc.