I just did something similar like this, its really quite simple.
For your ship. in the sprite editor add image points all over the ship where things can attach.
Next lets create a dummy sprite that will show up at wherever these attachment points are while the mouse is held down.
Mouse Event (On mouse down AND is touching ship addon part: eg: "lasers")
(Local variable - ShipAttachPoints
System For Each "Ship" -> Set ShipAttachPoints = Ship.ImagePointCount
(sub event) - For "y" from 1 to CountAttachPoints -> Create Object "Attachpoint" at Ship.ImagepointX(loopindex), Ship.ImagepointY(loopindex)
Pin Attachpoint to Ship
This will create attachpoint objects all over your ship at each imagepoint and pin it so that they follow your ship.
Next you need to check how far away the selected piece is to the closest ship attach point, and upon mouse release, snap the pieces together and pin the piece to the attachpoint.
On Mouse Release
Pick Nearest (attach point) (from attachpoint to mouse position)
(subevent) compare 2 values (distance(attachpoint.x attachpoint.y, mouse.x, mouse.y) < 10 pixels
subevent -> set position and angle of ship piece to attachpoint.
voila. The piece will snap to the closest attachment point when you release the mouse.