How can I avoid errors using a complex snippet when I need to re-run the snippet because I want to change an initial variable?

This is the Guidlines - How do incorporate your suggestion above to make it workable?

Thanks in advance

George