If it became unwieldy you’d turn it into a script:
#!/bin/sh
beautify() {
sed -e ‘
s/ugly/beautiful/g
…other stuff
‘
}
select() {
awk ‘
{print $2, $4}
…other stuff
‘
}
mycommand | beautify | select
For me, now it’s starting to look like it could be safer to do these things in a real language.