The action code
values() is your friend. It takes as input the name of the desired attribute, without a $ prefix. The action returns a de-duplicated list - i.e. one instance of each (case-senstive) value used; unused suggested values are omitted. To save fiddling with export, the easy method is to get the list and then format it into the $Text of a note, one value per line. You can then copy the values form the note and delete the note.
Thus to get a list of all discrete $Tags values in your document, make a new note and give it this edict(an edict so it’s not running all the time):
$Text = values("Tags").sort.format("\n");
Obviously, if you want a different target attribute (system or user) simply replace ‘Tags’ with the desired attribute name.
More on values().