We investigate laser emission from optically-pumped rotationally excited molecular gases confined in a metallic cavity. To this end, we have developed a theoretical framework able to accurately describe, both in the spatial and temporal domains, the molecular collisional and diffusion processes characterizing the operation of this class of lasers. The effect on the main lasing features of the spatial variation of the electric field intensity and the ohmic losses associated to each cavity mode are also included in our analysis. Our simulations show that, for the exemplary case of methyl fluoride gas confined in a cylindrical copper cavity, the region of maximum population inversion is located near the cavity walls. Based on this fact, our calculations show that the lowest lasing threshold intensity corresponds to the cavity mode that, while maximizing the spatial overlap between the corresponding population inversion and electric-field intensity distributions, simultaneously minimizes the absorption losses occurring at the cavity walls. The dependence of the lasing threshold intensity on both the gas pressure and the cavity radius is also analyzed and compared with experiment. We find that as the cavity size is varied, the interplay between the overall gain of the system and the corresponding ohmic losses allows for the existence of an optimal cavity radius which minimizes the intensity threshold for a large range of gas pressures. The theoretical analysis presented in this work expands the current understanding of lasing action in optically-pumped far-infrared lasers and, thus, could contribute to the development of a new class of compact far-infrared and terahertz sources able to operate efficiently at room temperature.