$Text = $MySet.sort.format("\n")
FWIW, collect() returns List-type data (originally is was Set-type) and you can get a de-duped sorted list in one go:
$Text = collect(children,$Topics).unique.sort.format("\n");
I do this a lot. If the ‘rule’ is to persist in my TBX, I generally use $Edict rather than $Rule to lessen the general load. If the source material changes often, I use $Rule but disable the Rule when not needed (…which is sort of how edits came about). Anyway, there are a few options.
More on available Action code operators.