Use select-line (ctrl-L in CUA mode) to select the lines to be sorted.
Use Esc to get to the command line.
Enter command "sort-within-selection UI" to sort the lines. Adjust options to your liking.
I frequently hit Esc and scroll up to my previous usage of the sort command (and a few others).