Edit
For order preserving as Jens says, I changed Attributes
ClearAttributes[Plus, Orderless]
HoldForm[7 + x + 2 + 4 + x + 5] /. f___ + x + l___ :> f + 4 + l
7 + 4 + 2 + 4 + x + 5
And you can revert by SetAttributes[Plus, Orderless]
Origin
How about this
HoldForm[x + 2 + 4 + x] /. x + a___ -> 4 + a
4 + 2 + 4 + x