I am curious as to how the flange becomes misaligned in the first place. Is this a feature of the part that happens to not be flat to the ground? If it is always off of flat, could you just compensate in your robot program to align it to a set point every time? Or, does the operator load the part differently every time? These are the questions I generally ask first.
But, from a robot programming standpoint, I would use touch sensing as follows:
1. Level the part where you want it and note the direction you had to spin the part to align it flat.
2. Place the robot on the edge you want to detect when it is "flat" (in your picture, I would use the other side).
3. Write a job to spin the positioner slowly from its original point in the direction it needs to spin to make it flat. Use the search until rapid input on on the detail edit screen of the positioner spin move.
4. When the part "touches" the robot, note the location of the positioner and shift the program by the difference in locations.
It is hard to explain, but I have written jobs in the past to clock a part on a positioner by spinning it into the parked robot in order to "detect" its location.
Another option you could do would be to take measurements at both edges and compare the Z element of the detected position and write a routine to move the positioner different amounts in different directions until the detected Z values are within whatever tolerance you need to call it flat enough.
If I have missed the mark for what you're looking for, please elaborate more.