Well, you could just paste that macro into an existing addon's lua file minus the "/run".
If you want to know the bare minimum you need to create an addon out of it you can take a look at
one of my addons or there are probably instructions around here somewhere, I know there was also a website that would generate the code for you and zip it but I don't remember what it was.