This line of code also crossed my way and I was wondering what it means.
Now I think the following: If the posted text only contains <p> and <br /> it shall be saved as only-text. If there are other html tags included, it gets saved as HTML. Probably the reason was to save database storage in removing the <p> and <br /> tags.
I don't know if it is a good idea, but I remember some of my users complaining about missing lines etc. but I cannot say if this was correlated to the preg_replace above...
The problem with this, however, is that a pasted text which is written in one line, e.g. "<p>Test</p> <p>Test</p>" will become:
Which is of course incorrect.