The . (dot) is combined with the -q switch, to make /echo not print anything in any window but still evaluate the text passed to it. So, we make $regsub() work without using any temporary variable for its evaluation.
The ! makes sure the internal /echo is called and not a possible /echo alias. This way you avoid possible conflicts (from a poorly written /echo alias, for example) and also speed it up, as the internal /echo will always be significantly faster than the alias.