Great question, it's probably lines like this where I use a loop to inspect every "simple entity" and only inject code into some of them:
-- Fix alien biomes rocks not having any dying explosion like vanilla ones
for _, simple_entity in pairs(data.raw["simple-entity"]) do
if string.match(simple_entity.name, "rock%-big%-") then
simple_entity.dying_trigger_effect = data.raw["simple-entity"]["rock-big"].dying_trigger_effect
elseif string.match(simple_entity.name, "rock%-huge%-") then
simple_entity.dying_trigger_effect = data.raw["simple-entity"]["rock-huge"].dying_trigger_effect
elseif string.match(simple_entity.name, "sand%-rock%-big%-") then
simple_entity.dying_trigger_effect = data.raw["simple-entity"]["sand-rock-big"].dying_trigger_effect
end
end