I have no idea of what you are trying to do. And I cannot understand your code unless it is formatted properly.
If you want to rotate groups, did you not try searching for help? You would have found Rotate a Group. But maybe that’s not what you want to do.
Once the group shape is rotated, you will need to make the dragComputation function smarter to recognize that the area inside the rotated rectangle is no longer rectangular in document coordinates.