The resource constraints of Internet of Things (IoT) devices pose significant hurdles to delay-sensitive applications that operate in dynamic and wireless settings. Since offloading tasks to cloud servers can be hindered by security concerns and latency issues, edge and fog computing bring computation closer to data sources. Given their inherently distributed and resource-constrained nature, edge/fog-enabled platforms require more advanced resource-management solutions to address the numerous constraints encountered in dynamic and wireless environments. This study introduces an innovative resource management algorithm designed for dynamic edge/fog computing environments, tailored to real-world applications, with the objective of enhancing delay performance through optimal container placement. The resource management problem incorporates mobility patterns in wireless settings to reduce migration delay and the processing history of edge/fog nodes to provide a novel method for computing processing delay, resulting in a combined optimization problem expressed in an integer linear programming (ILP) format. To address the formulated NP-Hard problem, we developed a low-complexity Metaheuristic Resource Management algorithm based on Particle Swarm Optimization (MRM-PSO) with effective particle modelling. Our experimental findings demonstrate that greedy heuristics and genetic algorithm (GA) are inadequate for efficiently resolving a given problem, whereas our proposed MRM-PSO algorithm efficiently locates near-optimal solutions within reasonable execution times when compared to exact solvers. MRM-PSO reduces execution time by up to 663.82 % in the worst case and 2307.5 % in the best case. Furthermore, it attains a delay that is just 0.98 % higher in the best case and 5.54 % higher in the worst case compared to the optimal solution.