Sure you copied/pasted the line correctly? It didn't crash when I loaded the mod into an existing game, and the migration was run.
Anyway, this breaks for a different reason: If the setting "deep_oil" has been turned off, neither recipes["oil_rig"] nor technologies["deep_sea_oil_extraction"] will exist. Try this instead:
if recipes["oil_rig"] and technologies["deep_sea_oil_extraction"] then
recipes["oil_rig"].enabled = technologies["deep_sea_oil_extraction"].researched
end