The following macro sorts your example (copied into an ASCII file) as you want it. Hopefully it works for your whole list. The macro property Continue if a Find with Replace not found must be checked for this macro.
InsertMode
ColumnModeOff
HexOff
UnixReOff
Bottom
IfColNum 1
Else
"
"
EndIf
Top
Find RegExp "%^([~.^r^n]+.[~.^r^n]+.^)^([~.^r^n]+.^)^(?*^)$"
Replace All "^2^3»^1"
Find RegExp "%^([~.^r^n]+.^)^([~.^r^n]+.^)^([~»^r^n]+^)$"
Replace All "^2^3»^1"
SortAsc IgnoreCase 1 -1 0 0 0 0 0 0
Find RegExp "%^([~»^r^n]+^)»^(*^)$"
Replace All "^2^1"
Add UnixReOn or PerlReOn (v12+ of UE) at the end of the macro if you do not use UltraEdit style regular expressions by default - see search configuration. Macro command UnixReOff sets the regular expression option to UltraEdit style.
Best regards from an UC/UE/UES for Windows user from Austria