Voltage sag is a significant power quality (PQ) issue in Nigeria's 330 kV transmission network, leading to equipment failures, data loss, and financial setbacks for both industrial and residential users. This paper dives deep into analysing and addressing voltage sag within Nigeria's 28-bus, 330 kV transmission system, alongside the standard IEEE 30-bus test network, utilizing a Particle Swarm Optimization (PSO)-based Static Synchronous Compensator (STATCOM). We conduct load flow analysis using the Newton Raphson (NR) iterative method, integrating the Power Injection Model (PIM) of STATCOM into the NR framework. PSO helps us optimally pinpoint the best locations and reactive power capacities for STATCOM units, effectively reducing voltage deviations across load buses. The simulations on the IEEE 30-bus system reveal that critical bus voltages improved from a low of 0.8963 p.u. to 0.9516 p.u. after compensation. In the Nigerian 28-bus system, buses 13, 16, 20, and 25, which initially showed sag voltages of 0.8905, 0.9230, 0.9648, and 0.9283 p.u., were restored to 0.9625, 0.9835, 1.0006, and 0.9824 p.u., respectively. The objective function, measured by the voltage deviation index, saw an impressive improvement of about 91.82%, highlighting the PSO-based STATCOM as a highly effective, cost-efficient, and computationally robust solution for mitigating voltage sag in complex transmission networks.