offcourse not failures code is kindof a guideline you could try, instead.
ConvertSelectionToVertices;move -ws -y 0;
on averaging.
Ofcourse the evaraging function must move the points along the neipboring ede direction so not to change their planarity.
Altough this is about the least usefull tool in the world