Isolating plugin scripts

I built the Autocomplete plugin based on this and what i did was put the allClearLetsGo() function inside an append to head function wrapped in script tags. The method works and has been tested using both bubble and non bubble maps and other elements both visable, hidden and some appended after the fact. This was what I came up with when bubble asked me to ensure that the google based plugins would be able to coexist with core elements and other devs elements aswell. I wish i could just chuck the code here but its a private version for a client so unfortunately i cant. The good news is though i can say 100% i understand the issue but more to the point 100% that its solvable this way.