This paper extends and improves the performance of a digital reversible watermarking algorithm based on histogram shifting presented in previous works. The considered algorithm exploits the property of image histograms of some kinds of medical images which present many contiguous 0-runs, i.e., a comb structure in the gray level frequencies. In particular, radiographic images exhibit this structure after contrast enhancement during the acquisition process. The previous work suggested performing gray-level histogram shifting according to a local optimization technique. In this paper, we apply combinatorial optimization techniques to entire blocks of contiguous 0-runs using a non-linear objective function transformed to fit a linear optimization algorithm. The obtained results show a meaningful improvement in the payload capacity of the original data-hiding method. A mild Peak Signal-to-Noise Ratio (PSNR) reduction is still acceptable for a qualitative preview of the images, which can be completely restored to their original cover form thanks to the reversibility of the method.