Abstract This paper presents a novel approach to optimizing plunger lift operations in gas wells through the development of an improved dynamic model and an efficient optimization algorithm. We introduce an enhanced plunger lift mechanism model that integrates reservoir dynamics using classic production relationships, such as Vogel's Inflow Performance Relationship (IPR), and accounts for variable plunger velocities. The model combines a two-phase component approach for liquid and gas with a black oil model, improving the accuracy of fluid property estimations and providing a versatile simulation tool. To address the limitations of traditional optimization methods, we implement an improved Simultaneous Perturbation Stochastic Approximation (SPSA) algorithm. This allows for real-time, intelligent optimization of critical plunger lift parameters, including cycle duration, plunger ascent time, and control valve status. The optimization method is applied to both dual-cycle and quad-cycle plunger lift scenarios. Results demonstrate significant improvements in net present value (NPV), with increases of 65% for dual-cycle and 98% for quad-cycle operations, without modifying underlying reservoir or fluid models. The model's key operational parameters show strong agreement with commercial software results, validating its accuracy and reliability. This research contributes to the advancement of plunger lift technology by providing a more accurate dynamic model and an efficient optimization methodology. The proposed framework offers valuable decision-making support for field operations, potentially leading to substantial improvements in production efficiency and economic outcomes in gas well operations.