On a similar note, how do you deal with players in the box on free kicks that are doing this similar tactic, sometimes starting to push each other?
Let them know you are watching? There is nothing wrong with the attacker moving around in front of defenders? Don't they have a right to space on the field as long as they are not impeding the player's forward movement? The side to side stuff seems legal.
Impeding is one of those rules in soccer that really requires some clarification and from prior discussions on this board there seems to be a big split of opinion on (particularly between the enforce the rules school of thought v. the let em play school of thought). It can easily spill into a holding or pushing foul if there's physical contact (which is further confused by the application of the "trivial" standard). It was originally designed to prevent formations that would run in the early 20th century like a gridiron football or rugby screen, with several players running in front of the player with the ball to serve as blockers. There's a conflict in the laws between the principle that every player is entitled to take occupy their space, but you can't prevent someone from taking space....the laws simply don't address what if 2 people want to occupy the same space simultaneously. But the lack of clarification of the rules leads to gems like these....
I think there's an argument in my original scenario that the goalkeeper was impeded, though I'm thinking because the impeding is controversial, and the offside is arguably the greater and clearer offense, you would punish it as offside.
I also can't think that the laws intended to allow the red player in the first video here to just splay out his arms like that, literally acting as a screen....it seems to run counter to the very spirit why the law was originally implemented since it shows a clear intent to just screen, and not to play the ball (since it's unlikely he'd be able to do so off balance). In these videos, because they are corners, offside obviously does not apply.