To affect a paragraph unit's format, the scope of the declaration must contain the blank line or @code{\end} command that ends the paragraph unit.
I cannot believe that \end was meant, but surely it was \par. It was written as intended, though it could surely be clearer. The idea being the well-known gotcha that if the raggedright group ends before before the paragraph ends, it has no effect. An example would seem to be in order. k P.S. Where did the phrase "paragraph unit" come from? Seems excessively technical and confusing, plus undefined. I'd prefer to just use "paragraph"(s).