This MEL script will align a UV shell to the grid depending on which 2 UVs are selected. Just select two UVs and run it.