It's an overwrite, not a merge.
For your situation you can use parent / child styles to separate your custom templates from the main style. For example, if you create a new style to contain your custom templates and then upload the custom style as a child of that style, then the custom style will inherit all of the custom templates from the parent. And those custom templates would not get overwritten when you overwrite the custom style with a newer version of itself because they are contained in the parent style which is separate.