QUARK MATTER FORMATION IN NEUTRON STARS AND IMPLICATIONS FOR GAMMA-RAY BURSTS