Commands in sed are separated by newlines. To match multiline strings, you can read multiple lines in pattern space with N command, then match them with \n regex for matching the newline. If the match is not found, you have to shuffle with hold space to: hold the pattern space, print everything up until the newline, switch pattern with hold space, remove from pattern everything up until first newline, read next line, repeat.
That would be something along:
sed ' : restart N;N;N;N;N; # read six lines, we need that many : loop # match six lines / type pulse\n fallback "sysdefault"\n hint {\n show on\n description "Default ALSA Output (currently PulseAudio Sound Server)"\n }/{ # replace them s// type plug\n slave.pcm hw/ # print and start over n ; b restart } # hold, print leading line, change, remove leading line h ; s/\n.*// ; p ; x ; s/[^\n]*\n// # append next line and loop N b loop '
As writing such scripts is hard (for most people ;), some just use GNU sed -z option:
sed -z 's/ type pulse\n fallback "sysdefault"\n hint {\n show on\n description "Default ALSA Output (currently PulseAudio Sound Server)"\n }/ type plug\n slave.pcm hw/g'
Note I think that using \n in replacement string inside s command is a GNU extension anyway.