Square brackets in this context mean the same thing as round parentheses. Would it help you if it was written as $$\left(5-(6-7(2-6)+2)\right)+4=5-(6+28+2)+4=5-36+4=-27$$
You can probably see why they are used from this; as too many $\color{red}{(}$'s make the expression unclear and therefore harder to process. So the $\color{blue}{[}$'s are used.
Or if you really prefer the round parentheses you can just make them larger:
$$\bigg(5-\Big(6-7(2-6)+2\Big)\bigg)+4=5-(6+28+2)+4=5-36+4=-27$$ Start by computing the inner-most (smallest) bracket and work your way outwards.
The other context apart from intervals as you mentioned in your post; like for some $x$ $$[0,1]\implies 0\le x \le 1$$ is that the square brackets are used to return the dimensionality of some formula eg. $$\begin{align}[\text{Speed}]=\mathrm{ms}^{-1}\ & =\quad\text{meters per second}\end{align}$$