Hot snot will do alright for basic anti-vibration stuff, and you can get higher temperature/stickier formulations that will hold up better with time, but it's not the ideal solution. Neutral silicone is the usual preference for electronics work - a bit more pliable and environmentally stable, while there should be some at a lot of hardware stores, the easy way to check would be to use a bit and let it partly dry. If it smells like vinegar, it's the wrong stuff, if doesn't have that smell, it's probably the kind that won't eat through PCBs.
Not exactly likely in a hardware store, but if you can find a conformal coating, that should be safe for electronics use if it's viscous enough to be an adhesive you're looking for.