NumDockPoints(ship);
It gives the number of docking places on the ship, including the breach points too. If not 0, you can dock.