I solved it this way:
Get external face of a wall:
IList<Reference> sideFaces = HostObjectUtils.GetSideFaces(wall, ShellLayerType.Exterior); Face face = uiDoc.Document.GetElement(sideFaces[0]).GetGeometryObjectFromReference(sideFaces[0]) as Face;
Get the normal vector of that face and revert it:
PlanarFace pf = face as PlanarFace; XYZ normal_reverted = -1.0 * pf.Normal;
Move the wall:
wall.Location.Move(normal_reverted * (wall.WallType.Width / 2.0));