“Shag” has lots of different meanings. It can mean rough or tussled hair. It can also be a type of rough-textured carpet. It can also be a type of cormorant or sea bird. In the United States of America it can even be a type of dance!
On the other hand, if during shooting practice, the basketball coach were to tell his team to “shag them” what would he mean? If it was a British basketball coach he might well be telling his team to not bother too much about winning the game coming up… but to make sure that they had sexual relations with the opposition.
In the much more likely event that the coach were from the United States it would mean that the coach wanted the players to collect all the basketballs from around the gym and return them to him or to the place where the balls are kept. To “shag” them means to collect the balls. There is a similar expression in baseball. During hitting practice when a player hits a fly ball into the outfield, the outfielder’s job is to “shag” it… i.e. to catch the fly-ball and throw it back. In golf you can even have a ball shagger which enables you to collect (pick up) practice balls without even bending over. Given that golfers often hit dozens of practice balls at a single practice session a ball shagger is probably a very good idea for lower back preservation.
If ever you are given a “shag the balls” instruction from your coach it is probably a good idea to clarify his meaning before taking action.