Here you go!
Note: store the balance as {bal::%player's uuid%} or it won't work
command /baltop:
trigger:
set {_sortedList::*} to sorted {bal::*}
loop {bal::*}:
add 1 to {_count}
set {_indexes::%loop-value%} to loop-index
if mod({_count}, 20) = 0:
wait 1 tick
set {_n} to 0
loop {_sortedList::*}:
add 1 to {_n}
set {_current} to {_indexes::%loop-value%} parsed as offline player
set {_msg::%{_n}%} to "&7%{_current}% &f- &6%loop-value% bal"
{_n} = 10
exit 1 loop
message "&7&m &7< &a&lTop Balances &7>&7&m "
loop {_msg::*}:
set {_current} to loop-index parsed as int - 1
set {_c} to size of {_msg::*} - {_current}
add {_msg::%{_c}%} to {_invertedList::*}
set {_n} to 0
loop {_invertedList::*}:
add 1 to {_n}
message "&a##%{_n}% %loop-value%"