Perhaps you can do this by using a choose expression for the Y value. So e.g.
Set Green Circle X to random(960)
Set Green Circle Y to choose(-20, 980)
This means the X will be completely random within 0-960 like usual, but it will choose either -20 or 980 for the Y value so it'll always be just above the window or just below it.
Edit: Oops, on rereading I guess I misunderstood the question.
Does the viewport move? I don't see why you can't just adjust the X value of the positioning so that green circles can't spawn outside the edge.