From what I understand about your question, and my understanding may be flawed, you are trying to flatten galaxy workflow into a script. It might be difficult but possible for some workflows but there is no way to automate that process through Galaxy. For many workflows this would be close to impossible task.
My advice is to create a Galaxy Tool from your colleague's R script instead and add it to the Galaxy Workflow. That is what Galaxy is designed to do.