Raw Input Desired Output
One.
Two three
four five.
Six.
Seven eight
nine ten
eleven.
Twelve.
One.
Two three four five.
Six.
Seven eight nine ten eleven.
Twelve.
Script and Comments
Script1
[ 1] :loop
[ 2] /\.$/b
[ 3] N
[ 4] s/\n/ /
[ 5] $!b loop
Comments
  1. 'Pattern space' is abbreviated to 'PS'.
  2. This script is a loop of 'check, then print or join'.
  3. If the contents of PS end with a dot, then just print it out.
  4. Otherwise,
    • join next line.
    • replace the embedded newline with a space
    • If the end of file is not reached yet, go to Step [1].