Just saw your mod updated, so walked in and saw this. ;-)
The pod reload code is made with such complexity, because I have enhanced it to apply to all locomotives and wagons of a train too in version 0.17.1.
You may take a look into code of former version 0.17.0, it would be much simpler to read and learn. It would suit your purpose, since you do not need to handle with trains.
OR if you want, I can add another pattern match (now I am using "^gunpod%-turret%-equipment") to specifically your equipment, so my code will support your mod as well. But then some modification maybe needed to make things compatible, e.g., I have set each ammo as 1E9 energy.