Try this form and see if the logic works correctly
If(
:Run F == 1 | :Run M == 1, "Leave",
:Run F == 2, "Keep",
:Run F == 3, "Upscale",
(:Run F == 4 | :Run F == 5) & (:Run S == 1 | :Run S == 2), "Fix",
(:Run F == 4 | :Run F == 5) & (:Run S == 3 | :Run S == 4), "Encode",
:Run M == 2, "Upscale",
:Run M == 3 & (:Run S == 1 | :Run S == 2), "Fix",
:Run M == 3 & (:Run S == 3 | :Run S == 4), "Encode"
)
Jim