UM, are you sure you are new to Factorio modding, or just new to programming in general? Or is lua just that different from other programming languages?
Because I just looked through some of the source code for Corrondum and this is.. pretty rough. Like, lack of basics rough... No offense. See below:

In this section specifically, at line 13, you don't need to write the whole thing out as:
if(handle_science_populate == true) then...
You can simply write:
if handle_science_populate then...
The handle_science_populate variable will evaluate to either true or false, depending on what happens in line 11, so you don't need to check it again.
Furthermore, on line 5, you map data.raw.lab to the local variable all_lab_types, but then... you only use it on line 14, under the condition that handle_science_populate is true. Why not just change line 14 to
for name, lab in pairs(data.raw.lab) do...
(renamed from "k,v" because k is the name of the lab, and v is the table that holds the rest of the table data for that specific lab)
Then on line 6, you ask why data.raw.tool['science-pack'] is nil, that's because there is no tool named "science-pack"
data.raw.tool is the table that contains all "tool" type items in the game, which includes science packs, for some complicated and historical reasons. If you want a list of all science packs, then you can just use another for loop, like:
for name, pack in pairs(data.raw.tool) do...
(where again, name is the name of the science pack, and pack is the table that holds the table data for that specific science pack)
And finally, on line 11, you have a check for
if mods["PlanetsLib"] ~= nil...
when you can shorten that to just
if not mods["PlanetsLib"]...
And then there's more of those if ... == true, which can be shortened in the same way as handle_science_populate.