"If" node versus "custom" one with "a>b" and similar operations

That would still be no. Custom node does not prevent constant folding. Documentation is worded a bit off and is interpreted in a wrong way.
Unreal’s material translator has a system, that evaluates the graph and if any parts of the graph are uniform(thus, being the same for all shader executions), replaces it with a value, that is calculated on CPU.
Custom material expression will never evaluate to a uniform material expression, and likewise, anything done within it won’t and this is the part documentation refers to. Shader compiler constant folding though will not be affected by custom node.

Guess what? You can move out all uniform operations with shader parameters out of custom node and keep them in the graph. So custom node being slower is myths and legends, provided, that you understand which parts of your graph are uniform.

Besides, the example from documentation page, namely Time->Sine->Mul by scalar is also wrong, as it will be not be evaluated as uniform.

1 Like