Every line here is correct; but it is easy to make a mistake by thinking the second line quoted implies that [MATH]x = \sqrt{4}[/MATH]. At first I was going to say it is incorrect, but I was wrong because of a technicality that many students miss. It's true that if two quantities, such as [MATH]x^2[/MATH] and 4, are equal, then their principal square roots are equal. The issue is to be sure you know what that means.
The next line, technically (though I've rarely seen it taught this way) should be [MATH]|x| = 2[/MATH], because [MATH]\sqrt{x^2} = |x|[/MATH], not just [MATH]x[/MATH]. I think you've discussed this recently (or was that someone else?). Then the next line is [MATH]x = \pm2[/MATH], because there are two numbers whose absolute value is 2. Commonly we just go straight from [MATH]x^2 = 4[/MATH] to [MATH]x = \pm2[/MATH], saying that we are taking the square root (really the square roots) of each side.
The danger is that many students forget the plus-or-minus when they take the square root; that's why it's safer to use the factoring method (initially), which forces you to see both signs. Of course, sooner or later (when you learn to complete the square) you more or less have to learn the plus-or-minus business.