I set a variable equal to a string of commands however the variable isn't returning a value, perhaps something is wrong in the return statement below where I declared the variable?
Very creative. You are not allowed to be so creative yet. You can't just make stuff up.
If you want to be able to refer to a "string of commands" you should look into and learn about functions.
As for returning anything, to whom do you think the variables were being returned, and what were they supposed to do with them? Again it looks like you have something in mind, but improvisation does not enter into writing code, certainly def not your code at this point in your learning curves.
What do you mean by "make stuff up"? I declared a value for the variable in the void setup, also while I will admit I am a beginner I do know the basic behaviors of functions, but not the extensive ones. Also, I might use an if/else statement to set a string of commands to a certain property of the variable, rather than what I currently have. As from previous comments, problems arise with the validity of that declaration. Also, I was going to return the variable when activating the string of commands however I never got to that point yet, I just returned it because, from my research, my error only occurs when the value wasn't returned and I wanted to see if the error would still occur. In the final product of the script, I would add more extensive instructions detailing what to do with the variable once it's returned.