Your expression is correct but it involves to minimize x which is hard when you try to just substitute |.| in a model. The absmip model (https://www.gams.com/latest/gamslib_ml/libhtml/gamslib_absmip.html) shows how to reformulate |.| with the help of a binary variable. You will need to have the some bounds on the variables involved or need indicators or a very complex SOS1 reformulation.