You could try doing what 5dim does for the pollution module:
itemPollution = table.deepcopy(data.raw.module["speed-module"])
recipePollution = table.deepcopy(data.raw.recipe["speed-module"])
techPollution = table.deepcopy(data.raw.technology["speed-module"])
and then just setting the new values on the now-copied tables.
He does that for tiers 1 and 4-10, for tiers 2 and 3 he copies speed-module-2 and speed-module-3 respectively.