Assuming you wans list as a table in AddOnList otherwise, remove the AddOnList references.
Lua Code:
local AddOnList = { list={} }
for i = 1, GetNumAddOns() do
local folderName, title = GetAddOnInfo(i)
if not exempt[folderName] then
tinsert(AddOnList.list, {name=title} )
end
end
table.sort(AddOnList.list, function(a, b) -- sort alphabetically
return a.name > b.name
end)