Reused components in same parent snippet

I'm attempting to extract some of our logic for reuse, especially when used in the same snippet. Are there any better options than this:

Which one? {dbselect: SELECT medName, raw_medication FROM tblMedications ORDER BY medName ASC LIMIT 2000; space=randomxyz; multiple=no; menu=yes; name=prescription; cols=75}
{{^^%E2%96%B6%EF%B8%8F^^}} {=prescription.raw_medication}
{if: contains(prescription.raw_medication, "Other")}
Other: {formparagraph: name=otherMedication}
{endif}

and the parent reusing:

{repeat: 1; locals=glp1prescription}
{import: .import-unique-test}
{endrepeat}

Global variables from the local scope:
{=glp1prescription[1].prescription.raw_medication}
{=glp1prescription[1].othermedication}

{repeat: 1; locals=contraveprescription}
{import: .import-unique-test}
{secondPrescription=prescription.raw_medication}
{endrepeat}

Global variables from the local scope:
{=contraveprescription[1].prescription.raw_medication}
{=contraveprescription[1].othermedication}

Hello Josh,

That's a great solution you have, especially the combination of import with the repeater "locals" variable.

Using imports is what we tend to recommend for reusing snippets, so you're on right track.