The error says "unbound variable: myimage". This is telling you that you are referring to a variable/function called "myimage," but you never defined that variable, so it doesn't know what "myimage" represents.
Do you know what "myimage" is supposed to represent? Did you copy that from another person's script?
The function gimp-file-load returns a list containing the image that you opened. You need to use the "car" function to extract the first entry from that list, so that it can be stored in your "img" variable. So instead of (img (myimage (gimp-file-load RUN-INTERACTIVE filename filename))) it should say (img (car (gimp-file-load RUN-INTERACTIVE filename filename)))
Also, I think you might want to use RUN-NONINTERACTIVE instead.
Similarly, I think you will need to change each other instance of (my image ...) to be (car ...) instead.