In recent years, visual SLAM (Simultaneous Localization and Mapping) based on line feature tracking has garnered widespread attention due to its provision of additional constraints for structured scenes. However, the current mainstream framework, PL-VINS, faces several challenges, such as overly simplistic line length pruning strategies and the utilization of fixed loss functions in point-line backend optimization. To address the former, we propose a novel line-length pruning strategy that dynamically determines pruning thresholds based on the average length of lines extracted from the current frame image. Regarding the latter, we introduce the concept of point-line weighting, which involves dynamically adjusting the size of the loss function based on the ratio of points to lines within a sliding window. Experimental results on public benchmark datasets demonstrate that, compared to the PL-VINS method, our approach achieves a 6.79% average improvement solely by employing the enhanced line length pruning strategy. Furthermore, by simultaneously adopting the improved line length pruning strategy and dynamic point-line weighting for backend optimization, our method outperforms the PL-VINS method with an average improvement of 23.60%. This indicates that our proposed enhancements elevate the accuracy of SLAM.