What is the concrete uses of GLSL / HLSL ?

Unreal’s constant folding mean that material networks are evaluated, and any inputs on any pins, that are evaluated as constants, are collapsed to such. This is the only part of optimization you are missing out when using custom node.

There is no kind of decision about vertex/fragment shader you are mentioning. If a node is used in pixel shader related material inputs, it will be part of pixel shader. If it is part of vertex shader material inputs(world position offset, custom UVs, vertex interpolator), it will be part of vertex shader.