not your fault here (but mine) : this line should better go inside each "if(old_version==x && new_version==5)" conditions, so next version upgrades will not reset the values.
Otherwise, this seems ok for me, and this will solve presets/styles upgrade too.