I was nearly there—when placing, the resulting snippet had even correct preview, but ony the first of exported objects was placed actually.
IDMS file is twice less in size compared to a snippet made with manual export and has only this first object in section where spread is described.
The manually exported and script-generated (through grouping before export) are identical except the aditional group wrapping contents of the snippet. I can delete this group in xml, but some snippets should be a single group, so it is not a way. And automating this would be another headache.
Indesign has Snippets and Snippet classes, but I did not found any traces of practical use of these. Maybe they could help. Any ideas?