You're taking advantage of being near her to get all clingy!!
Literal
You [subj-が] nearby existing [obj-を] good-thing [as-に] clingy-doing [derogatory-やがって]!!
~をいいことに 'taking advantage of / using as an excuse' is a set construction for criticizing someone who exploits a situation. ベタベタ is a mimetic for being clingy/touchy — physically sticking to someone. ~しやがって is the derogatory te-form — expressing ongoing contemptuous anger.