A gel-based floating matrix tablet was formulated and evaluated using the sublimation technique to enhance gastroretentive drug delivery. Anhydrous theophylline was employed as the active pharmaceutical ingredient, combined with sublimation agents and hydroxypropyl methylcellulose as the gel-forming polymer. The resulting tablets exhibited high porosity, immediate floatation, and sustained buoyancy for over 8 h. Optimization of the floating behavior and drug release profiles was achieved by adjusting the viscosity of and hydroxypropyl methylcellulose and the concentration of sublimation agents, specifically ammonium carbonate and menthol. These agents were selected for their effectiveness in creating a porous structure, thus reducing tablet density and enhancing floatation. Higher HPMC viscosity resulted in increased floating force, slower drug release, and improved swelling properties due to a slower erosion rate. A critical assessment of the balance between tablet porosity, mechanical strength, and drug release kinetics indicates that ammonium carbonate provided superior tablet hardness and lower friability compared to menthol, favoring a controlled release mechanism. The release dynamics of theophylline were best described by the anomalous (non-Fickian) diffusion model, suggesting a combined effect of diffusion and erosion. This research advances the development of gastroretentive drug delivery systems, highlighting the potential of sublimation-based floating matrix tablets for sustained drug release.