Copying a sketch from a microcontroller

@GDH5,
You might be better off compiling a known sketch, then look at the .hex file that was created and see if you can work backwards from there.

There are decompiler programs such as this
https://www.hex-rays.com/products/decompiler/index.shtml

You can search for an 8-bit AVR version, some links here maybe: