...if mod is added to a game where the science packs are already researched.
for _,force in pairs(game.forces) do
force.recipes["artillery-combinator"].enabled = force.technologies["artillery"].researched
end
This is how "Artillery Combinator" unlocks its recipe if the tech is already researched. Just put it in migrations/modnameOrSomething_1.1.6.lua and it will run once and fix it.
I unlocked my recipes with the command
/c for i, v in pairs(game.player.force.recipes) do if string.find(v.name, 'science%-ore%-to%-science') then v.enabled = true end end