Thanks but I’m trying to set it up so that when I’m working with the shader at design time I can rapidly switch between render modes using the inspector instead of swapping the modes in the shader code editor.
You can’t. Render mode changes requires shader source code change and recompilation.
Use the alternative I suggested.
If you don’t write your own script, you can use a visual shader instead. It will let change the render mode from the inspector, but under the hood it will do precisely what I described - change the source code and recompile.
The purpose of blending modes is to specify how is shader output blended with what’s already in the framebuffer. Shader doesn’t “know” what’s in the framebuffer and hence its code cannot perform that blending operation.
This snippet certainly won’t replicate additive blending. It will use mix in both cases as that’s the default mode.