Click and Drag with overlapping objects

In my searching of the forum on alternatives for the “non optimal behavior” (thanks for that @ddabrahim) of the draggable behavior, I discovered the following post:

So, I removed the Draggable Behavior from all of my objects and adapted the code from Lizard-13 (thank you!) to my purposes. Specifically, I didn’t want the shape to jump when the mouse was clicked, so I added the X and Y offset values. From the user’s perspective, it looks just like a normal drag and drop scenario, but underneath it really isn’t.

While it probably isn’t the most efficient way to handle this issue, at least I have a workaround. I hope that @4lan can come up with a fix to the draggable behavior that will eventually make this code unnecessary.

For those interested, the block of code is as follows:

This is going to be painful when I start dealing with all 10 shapes in the puzzle, but at least i don’t have to worry about shapes overlapping and/or overlapping hit boxes.

Since I’m still learning this system, is there a way to optimize my solution using External Events or Functions or custom Behaviors?