Hmm, it still doesn't work :(
You know, I even tried echoing $CustomGui::AddonCount and nothing appeared in console :I
EDIT: !!!! I tried doing customGameGuiServer::populateAddonList(); and it looks like it DID reorganize the list, buuuuuuuuut when I restart the server everything is still completely randomly executed.
$CustomGui::AddonCount is not a thing. You are thinking of either
$CustomGameGui::AddonCount or
$CustomGameGuiServer::AddonCount.
When testing on a dedicated server, I had to manually invoke
customGameGuiServer::populateAddonList(), too.
$CustomGameGuiServer::AddonCount is not assigned any values until you populate the add-on list. It seems the dedicated server does not do this immediately after the server starts since it has no need to. Whenever the need arises for the add-on list to be populated, the script I posted should alphabetize it.
But if you really need to populate the add-on list when the server starts for one reason or another, you could just modify the script I posted. Just add
CustomGameGuiServer::populateAddonList();
to the last line of server.cs.