I know all of this off the top of my head, so less than a minute all up. Well, except the line(".") bit; that didn’t occur to me until I’d done it manually with the help of v_g_CTRL-A, and I had forgotten about the "." argument until I looked up its docs—haven’t used it in a while.
1. copy the text 2. split by \n 3. sort by length 4. you got sorted list