I'm not 100% sure what you're looking for, but placing "\parfillskip=0pt" at the start of the paragraph will make the last line end on the right margin, which I think is what you mean by "rectangle shaped".