Infinity War screenwriters Stephen McFeely and Christopher Markus have revealed that Chris Pratt and James Gunn made a pretty big change to the script that helped the story along. This isn't the first time that James Gunn has been credited to some of the more heavy use of the Guardians of the Galaxy in Infinity War. The Russo Brothers have said that the director was a great help while making the movie, even offering up a list of songs to choose from while introducing the characters on the screen for the first time. There are SPOILERS for Avengers: Infinity War below, so read ahead at your own risk.
In Infinity War, Gamora (Zoe Saldana) asks Peter Quill (Chris Pratt) to kill her if Thanos is able to capture her. Gamora doesn't tell Quill, but she knows where the Soul Stone is hidden and knows that Thanos will stop at nothing to retrieve the precious stone. When the time comes, Thanos does capture Gamora with the use of the Reality Stone, leaving Peter Quill to have to deliver on his promise.
However, Stephen McFeely and Christopher Markus did not originally have Peter Quill following through with his promise to Gamora. It wasn't until Chris Pratt and James Gunn stepped in to suggest the change that the screenwriters decided to change the part and have Quill actually fire his blaster, only to have bubbles come out. The scene is one of the more emotional in the movie and gives Peter Quill and Thanos a deeper connection down the road. McFeely had this to say.
"The more I think about it, the better it is that it got changed... Thanos has that same choice later (to kill Gamora), and he chooses to do it and succeeds."
James Gunn and Chris Pratt helped to craft a part that became more emotional and helped fit into the narrative even more than what Christopher Markus and Stephen McFeely had in mind. Leading up to that scene, when Gamora is asking Peter Quill to fulfill the promise, Drax can be seen watching the couple. Drax humorously believes that he's invisible, which is another scene that James Gunn had a hand in helping out with.
The Russo Brothers, along with Stephen McFeely and Christopher Markus, had a lot of collaboration to tend to in order to get all of the movies working together. When asked who had actually seen Infinity War before the world premiere, the Russo Brothers admitted that only fellow Marvel Cinematic Universe directors had access as to help their storytelling processes for the future of the MCU. It seems that there were some more elements that the Russo Brothers had help with in Infinity War that should come to light soon. You can read more about the ending of Infinity War and some of the script changes via BuzzFeed.