I sketched a playing stategy for the line. It's pretty complicated, but if I didn't miss any point, the line should be able to reach the flags, no matter where they're placed.
In order to evade getting in a locked position, the line needs to restrict its movements in a way such that the projection of the set of all visited points into the horizontal plane has a total area of zero (i.e. It's a curve). This way, it will always be able to escape by going up or down from the neighborhood of any point in the plane.
To show that any flag is reachable in this way, first notice that the ones in unvisited areas are trivially reachable within these constraints: As long as the line is kept vertical, its shadow will not sweep any area on the xy-plane. For areas which have already been passed by, the mechanism is slightly more complex.
During vertical motion, small horizontal displacements would be necessary to avoid self collision. However, it would not be a problem, since for any obstacle at some nonzero horizontal distance, an even smaller horizontal displacement would be possible.
Suppose, now, the flag lies on the curve. It can be shown, upon suitable tameness conditions (piecewise differentiability), that there can be found in its neighborhoood infinitely many line segments of unvisited points. These correspond to vertically unbounded areas which are completely free for maneuver. They can be reached from above or below by using the escape method explained at the start.
Consider one of those areas. In the worst case, every point directly above and below the flag is already visited. But by simultaneously moving forward, up/down, and tilting the top it is possible to make it reach the goal. After that, the vertical orientation can be restablished without self-intersections, by going backwards, tilting back up and moving downwards fast enough to compensate.
This entire process can be done in arbitrarily tight horizontal spaces, by shrinking the tilting angle (tilting less). Since the only rotation involves the plane of movement, it preserves the property that the projection of visited points forms a meagre set.
Here is an illustration of this mechanism:
Please, don't comment. I used all my drawing skill to make this one