I only looked through the file but you're missing a "0" for chaff in prog 3:
-- MAN 3 WVR Flares
programs[ProgramNames.MAN_3] = {}
programs[ProgramNames.MAN_3]["chaff"] =
programs[ProgramNames.MAN_3]["flare"] = 1
programs[ProgramNames.MAN_3]["intv"] = 0.25
programs[ProgramNames.MAN_3]["cycle"] = 5
Perhaps this is causing the issue?