If you see the code the target elements are selected based on data attribute and which is common for all the targeted elements within the multifield item. That's why on the selection of one other also getting changed.
To handle this you can find the index/position of the multifield item. If dropdown and targeted element both are within the same multifield item then only do show hide for this set of items.
Example code:
dropdownshowhide-multifield.js
This code will only be triggered when you have a select field with class or granite:class property with value cq-dialog-dropdown-showhide-multi unlike cq-dialog-dropdown-showhide
Option 2:
https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/show-hide-dialog-fields-ba...
//You can refer AEM form component (/libs/fd/af/components/aemform). Asset Type (radio button) field has show-hide functionality .