How to produce two glossaries from one dictionary or source file?

This is true, the original spec didn’t mention it, so you make a fair point. (I am the OP.) It developed over the course of the conversation.

For posterity, and anyone interested, here is a modified version of Andrew’s helpful code above (using VS Code’s integrated Claude LLM assistant), to achieve the goal of (a) two glossaries drawn from one dictionary, (b) where one key term may have multiple target terms, (c) where each target term may have its own description, and (d) each key term finally prints out all the associated target terms coupled with their respective descriptions:

#let print-glossary(entry-list) = for entry in entry-list {
  show: block.with(spacing: 1em)
  strong(entry.key)
  h(.75em)
  entry.long
  if entry.description != none [: #entry.description]
  "."
}

#let transform-glossary(data, swap: false) = {
  if swap {
    data
      .map(entry => array
        .zip(entry.long, entry.description)
        .map(((long, description)) => (
          key: long,
          long: emph(entry.key),
          description: if description != [] [#description]
        )))
      .flatten()
  } else {
    data
      .map(entry => {
        let parts = array
          .zip(entry.long, entry.description)
          .map(((long, description)) => {
            if description != [] {
              emph(long) + [: ] + description
            } else {
              emph(long)
            }
          })
        (
          key: entry.key,
          long: parts.join([; ]),
          description: none
        )
      })
  }
    .sorted(key: entry => entry.key)
}

#let glossary-data = (
  (
    key: "Foo",
    long: ("Lorem", "Ipsum"),
    description: ([Comment A1], [Comment A2]),
  ),
  (
    key: "Bar",
    long: ("Dolor",),
    description: ([Comment B],),
  ),
)

#let english-to-latin = transform-glossary(glossary-data, swap: true)
#let latin-to-english = transform-glossary(glossary-data, swap: false)

=== English to Latin
#print-glossary(english-to-latin)

=== Latin to English
#print-glossary(latin-to-english)

Again, it might be a bit verbose (again, due to the LLM bits). In any case, many thanks to both @quachpas and @Andrew for their help!