In the paradigm of mobile edge computing (MEC), providing low-latency and high-reliability services for users is garnering increasing attention. Appropriate edge-server placement is the crucial first step to realizing such services, as it can meet computation requirements and enhance resource utilization. This study delves into efficient and intelligent dynamic edge-server placement by taking into account time-varying network scenarios and deployment costs. Firstly, edge servers are classified into static and dynamic ones. Subsequently, an improved snake optimization algorithm is proposed to determine the number and placement locations of dynamic servers while adhering to delay requirements. Finally, a minimum placement-cost algorithm is put forward to further reduce the service cost. Experimental results demonstrate that compared to classic algorithms, the proposed algorithms can achieve a reduction in latency of 5% to 12%. And compared to the state-of-the-art methods, they can reduce service costs by 20% to 43%. This research offers an effective solution for dynamic edge-server placement and holds great theoretical and practical significance.