The framelines are, indeed for framing. Specifically, they are for framing the in-focus subject.
With a rangefinder (or a bright/brilliant finder), you do not have the same view of the subject as the lens does; you are looking through something that is (usually) slightly above and to one side of the lens. (With the Rapid, it is in fact significantly above and to the left.) When you are taking a picture of something that is "at infinity" (that is, something that is very far from the camera), the difference in viewpoint is nearly insignificant.
As the subject gets nearer to the camera, though, the difference in viewpoint between the viewfinder and the lens begins to matter. Things in the distance will still appear in pretty much the same place. If something 1km away is moved 10cm, you're really not going to notice it much, are you? But that distance between the centre of the viewfinder optic and the centre of the taking lens is going to make quite a bit of difference when the subject is only one or two metres away. That is why the frame lines move in the direction of the lens as you focus closer.
And, as you noted, the frame lines (the "box") gets smaller as you focus closer too. That's because the lens is moved further away from the film plane as you focus closer, so the image it projects is larger. All lenses worked that way until relatively recently, though the trend for the last two or three decades has been to move towards internal focus designs that minimize or eliminate that behaviour.
Since the viewfinder and the taking lens cannot see the world through the same eye, so to speak, there is some safety factor built in. If you frame a human subject to be in the centre of the picture at head-and-shoulders size, you'll actually be seeing them through the viewfinder from about a five-degree different point of view than the lens is looking from. Now, a person's head is close enough to round that a couple of degrees one way or another isn't going to change the apparent size much, but not everything in the world is vaguely spherical, so you do need some "slop" in the system. Rangefinders are not very good for precise framing, but they do try to make sure that at least you don't cut things off that you wanted to make sure were in the final picture.
Interchangeable-lens rangefinders also have different frame sets for different lenses. In a compromise between usability (how much junk is visible in the viewfinder) and complexity (how complex the finder frame mechanism needs to be), the framelines are often paired. It would have told you in the camera's manual which frame in each set was for which lens. Your Rapid is a 6x7, which means that the frame that gives you about the same as a 40mm lens on a full-frame (35mm format) camera is the one to use with the 90mm normal lens. (According to the manual, that would be the larger frameline set).