To enhance the positioning accuracy of the crane on a 65m-span bridge erector and suppress steel box girder swing, an improved super-twisting sliding mode controller is designed and its gain parameters are optimized. Firstly, a system dynamics model is established using Lagrange’s equations of second kind, with implicit functional relationships between variables derived from the hoisting system’s complete constraints. Then, a hyperbolic tangent function is introduced to mitigate chattering in the super-twisting mode controller, and the system’s stability is proved based on the Lyapunov theory. Subsequently, the superiority of the designed controller is verified through comparative analysis with traditional control strategies. Finally, the controller parameters are tuned using an improved grey wolf optimizer (IGWO). The results show that the improved super-twisting sliding mode controller effectively reduces control force chattering and demonstrates advantages in crane positioning accuracy and residual oscillation suppression. After IGWO optimization, crane displacement response becomes more precise, while system swing angles and control force peaks are further reduced, demonstrating significant engineering application potential.