あんま綺麗じゃないけど、こんな感じでいいのか?
競プロの連中ならもっとスマートなの書いてくれるはず

text = "aaabbc"
char = "abcdefghijklmnopqrstuvwxyz"

char_dict = []
for c in char:
____count = 0
____for t in text:
________if c == t:
____________count += 1
____if count > 0:
________char_dict.append({"name":c, "count":count, "left":count})

char_dict = sorted(char_dict, key=lambda e: (e["left"], -e["count"]), reverse=True)
result = ""
pre = ""
for _ in text:
____ci = 0
____while True:
________now = char_dict[ci]["name"]
________if now == pre:
____________ci += 1
________else:
____________result += now
____________pre = now
____________char_dict[ci]["left"] -= 1
____________char_dict = sorted(char_dict, key=lambda e: (e["left"], -e["count"]), reverse=True)
____________break

print(result)