Maybe you could use the pallet wizard from UR to pick you part. That could ease the programming.
As for the precision, it is important to have a well calibrated robot. If you have repaired your robot and did not redo the calibration you may experience some precision issues.
Even if your program is nealy perfect you will most probably have some remaining imprecision due to environment variable. You could use the force sensor of the robot to correct miss positioning. You can for example use a force node to free motion on x or y axis when you close the gripper.
I am using my pallet as a feature plane and three corners of it as feature points to define the plane. In my program I use x_offset = g_loadtray_x*-2.82*25.4/1000 to set the x parameter. What I'm doing is picking a part up using that algorithm and loading it into a cnc. It has to be very precise since it is a square shaped slug and must enter the jaws in a specific way. I have g_loadtray_y that will increase as it picks up a part and then g_loadtray_x after g_loadtray_y hits a certain number so it can move on to the next row. The issue I'm having is that my x parameter is so inconsistent from one row to the next. How can I fix this issue? I'm using dual HandE grippers, but only one gripper is picking up the parts to be loaded. My pallet is as level as I can get it and my orientation is straight as well on the gripper.