I think most people wrestle with this. What I do is:
- append the current date to just about every file or project I start.
- save different versions with different dates.
- have a 'make' folder on a 1 TB USB drive that contains just about all the crap and nonsense I've ever made, with categories such as 'web', 'windows', 'osx', etc. And then subfolders 'max', 'c++builder', 'arduino', etc. This huge folder is auto backed up to another drive using an rsync command in my crontab:
# Backup make folder.
22 4,10,16,22 * * * rsync -arutxq /Volumes/440Hz/make /Volumes/Backups/Backups/ &> /dev/null
- have a Crashplan account that just silently backs up everything in the background all the time.
So that's the part where I keep everything. As for your basic question: I put Arduino code that is important to a max patch somewhere in the max patch as a comment. At least then, when I open something a year later, I know exactly which Arduino sketch was working with that Max patch.
Also: comment comment comment! Even the silliest things go into comments. I just have too many projects going on, so I might forget that I have to double-click [midiin] and choose this and that midi in device. So that goes into a comment as well.
GitHub? Well, I have hesitated to litter it with my code snippets, but I've chosen to use it only for ongoing projects. But I don't see why you shouldn't put your useful scripts in there. Especially when they stand on their own.
When projects are completely "married" to certain files, where everything belongs together, I also save them together. Ableton Live has a great "Collect All and Save" command. If there's a Max patch that's vital to such a project, I copy it there myself too.
And for procedures I had to figure out, I just share them on my website: henszimmerman.com. But I've been planning since forever to move all that to other places, like Instructables. Sigh, the working married life with a kid, huh?
Good luck!
Anyways, that's just me.