The two-pin connector is a digital connector, so yes in general it will provide better sound quality. There is less chance for the analog signal to be corrupted in the noisy internal environment of the computer between the CD-ROM and the sound card. Also, the digital-to-analog converter on your sound card is likely to be better quality than the one built-in to the CD-ROM.
For digital audio extraction, it won't make any difference, because digital audio extraction doesn't use either the 4-pin or 2-pin connector. It uses the IDE ribbon cable.
By the way, you can also enable digital audio playback through the IDE cable to your sound card. Some people don't like to do this though, because it puts a little bit more drain on system resources than using the 2-pin connection directly between the CD-ROM and sound card.