Assuming that the if closing '}' brace is at the beginning of a line, you can use:

:g/if.*{/+,/^}/-fold

This folds the statements within the {} braces of the if, excluding the braces themselves.

This is achieved through the + and - movements put after the patterns that define the g range (there's a coma between the patterns): + moves down the range by one line from the first matched pattern (/if.*{/) and the - moves the range one line up from the second matched pattern (/^}/)

If you have indented closing '}' braces or for any circumstance where the above command does not apply, you can try to look for other patterns that you can exploit and change the ex command above as needed.