It has taken me some time to get the materials suggested by you all, assimilate them and try some of them. I thank you very much for your help. I think that I have learnt quite a few things in the process, so that I will try to sythetize them here just in case they could be of some help to someone else in the future. I regret that they have to be rather verbose to pretend any utility at all.
The nature of the problem
The first thing that I see more clearly now is the nature and the causes of my original problem.
The handheld scanner has two sources of image distortion that the flatbed one does not:
1) irregularities in the velocity of its forward displacement (which will influence the number of resulting scan lines and its contents) and
2) lateral deviations from the initial direction of the scan (which will deform the image's perimeter).
The first one will be seldom detectable to the unaided eye if present only in small amounts, unless the subject matter provides strong helping clues (like some kind of grid or reference lines). The perception of the second will be on the contrary usually unavoidable, given the mathematical exactness that should have the contour of the resulting image (rectangle or square) and the extreme sensitiviness of human vision to squareness.
Perspective
Fortunately neither of these devices can have problems related to perspective, as none of them generates its image by conical or pyramidal projection through pointlike apertures (stenope, pinhole, lens system). Its optical mechanism provides ideally a contact copy (in old photographic terms) of the original. The surfaces of the object and image planes are parallel and therefore cannot produce perspective distortions (which are consequent to distances and angles intervening between them). What is more, each pixel of the sensor has its own exclusive aperture for itself so that posible perspective problems would be limited to its minuscule individual area. The perspectival aspects of paintings and photographs extend on the contrary to the whole surface of the image.
Therefore the tools provided by image manipulation programs for handling perspective issues (in its proper sense) are not pertinent to this case. As well the Tools / Transform tools / Perspective tool as the very well conceived and exemplarly documented Ez perspective filter of Gimp (http://registry.gimp.org/node/24537) deal with the image as a whole, as they should do, whereas what the problem under consideration usually requieres is the manipulation of just some part of it.
Skew
Although I am not sure of the proper technical meaning of this term, as I have seen it used loosely in different contexts, I conclude that the more common one would refer to the angle that the whole image or some subset of it (for instance a text column) makes in some direction with the system of coordinates currently operative as reference. Of course the present problem implies skews in this sense also, but the important ones are determined by its relation to the straight parts of the same image and much less to the axes of the coordinate system.
Therefore the deskewing algorithms that I have been able to examine are also unsuitable for the task, as they deal with the whole image and take care only of its rotation as such. In the case of Gimp's obscure, difficult to get and undocumented deskew plugin all it seems to be able to do is to perform automatically small rotations of the whole image around its geometrical center (http://registry.gimp.org/node/22177).
The appropriate tools
So is there no way out of the difficulty?
No, I think that there are enough. As the problem under consideration is one of partial image distortion, its solution must necessarily come from the application of a neutralizing complementary distortion at the right places and in the right measure.
Gimp has several complements that can be used for this: Filters / Map / Displace, Filters / Map / Warp, Filters / Generic / Convolution matrix or Filters / Distort / Curve bend. But all of them are quite subtle to understand (especially because Gimp's pedagogical materials keep being much poorer than the program after so many years) and difficult to apply, although for different individual reasons. They can do the job but they require a lot of effort and patience in their application. Its use should better be compared to the old procedure of retouching negatives or paper positives manually than to the effortless automatic performance which we have come to expect nowadays of magical computer algorithms.
But one can learn a lot by studying and applying them. Just reflecting about how one should structure an eventual Gimp script or complement that helped to perform programmatically this operation would be a nice and instructive exercise.
Concluding (practical) remarks
the graphical reproductions obtained with handheld scanners will almost always be affected by distortion of several kinds in variable amounts. Such distortion is aleatory and nonlinear and therefore very difficult to remove by procedural rules (algorithms) of an elementary nature. Through the retouching process one can only aspire to replace one kind of distortion with another less objectionable.
if it is unavoidable to use such devices for demanding work, one has to ponder the relative convenience of these two ways of behaving: either to make as many trials as necessary until obtaining one result that is passable (or can be made so with elementary manipulations only) or to devote a lot of time and skill to rectify the bigger distortions of a faulty one with the generic deformation tools available in contemporary image manipulation programs. Or both.