Lightning strikes can cause equipment damage and power outages, so the distribution system's reliability in withstanding lightning strikes is crucial. This research paper presents a model that aims to optimise the configuration of a lightning protection system (LPS) in the power distribution system and minimise the System Average Interruption Frequency Index (SAIFI), a measure of reliability, and the associated cost investment. The proposed lightning electromagnetic transient model considers LPS factors such as feeder shielding, grounding design, and soil types, which affect critical current, flashover rates, SAIFI, and cost. A metaheuristic algorithm, PSOGSA, is used to obtain the optimal solution. The paper's main contribution is exploring grounding schemes and soil resistivity's impact on SAIFI. Using 4 grounding rods arranged in a straight line under the soil with 10 Ωm resistivity reduces grounding resistance and decreases SAIFI from 3.783 int./yr (no LPS) to 0.146 int./yr. Unshielded LPS has no significant effect on critical current for soil resistivity. Four test cases with different cost investments are considered, and numerical simulations are conducted. Shielded LPSs are more sensitive to grounding topologies and soil resistivities, wherein higher investment, with 10 Ωm soil resistivity, SAIFI decreases the most by 73.34%. In contrast, SAIFIs for 1 kΩm and 10 kΩm soil resistivities show minor decreases compared to SAIFIs with no LPS. The study emphasises the importance of considering soil resistivity and investment cost when selecting the optimal LPS configuration for distribution systems, as well as the significance of LPS selection in reducing interruptions to customers.