This post seems like a good reference for implementing pushing/popping to a str-list, but also seems to confirm my suspicion that you’d have to manually manage the format of each item added to the list.
As you’ve discovered, a str-list is more like a set or even a bag than a stack or an array. It keeps each item separately (there’s no need for a delimiter character or worrying about escaping) but you can’t easily iterate over the items from within Kakoune, or grab an item by index.
Beyond just adding and removing items, you can also access items by index if you write a custom command:
define-command -params 5.. access-by-index %{
info "Item 3 is %arg{3} and item 5 is %arg{5}"
}
access-by-index %opt{mystrlst}
You can also filter the list for items matching a regex, by copying the option into a register, pasting the register into a scratch buffer, using <a-k> to filter the selections, then yanking the results back into a register and copying it back to the option.
If you bring the option into a shell block with $kak_quoted_opt_mystrlst then you get a lot more flexibility, of course.