The 1987 housing market was the best since 1979, the California Assn. of Realtors reported. Statewide, 506,979 existing, single-family detached homes were sold during 1987, a 4.6% increase from 1986, the best since 584,185 homes were sold in 1979. The median price of a California home increased by 6% to $139,424 in 1987, the association said. The higher statewide median price was fueled by a tighter inventory of homes for sale. Among the six major metropolitan regions, Orange County carried the largest percentage increase in the median price of a home, jumping 13% to $166,948 in 1987.