The normal is actually a 3 dimensional normalized vector. So each component of the normal is in the range -1 to 1. Of course using the normal as color will produce issues with negative numbers since colors are only specified between 0 to 1. Negative numbers would just be clamped to 0.

By multiplying the normal by 0.5 we essentially transform the original range from -1 to 1 into -0.5 to 0.5. By adding 0.5 to the result we shift everything by 0.5 so the new range is 0 to 1