You can combine your first four commands into a single sed command. Since it appears you have an example that uses multiple nested directories (grep -r) you can use find + sed. And since you used grep -i I'll assume that pass= could be in any case.
Sorting the wordlist by most used password first isn't a bad idea I suppose, you could still work that into that.
Code:
find -type f | xargs sed -rn 's/^[Pp][Aa][Ss][Ss]=(.*)$/\1/p' | sort -u >wordlist_whatever.txt
Sorting the wordlist by most used password first isn't a bad idea I suppose, you could still work that into that.
Code:
find -type f | xargs sed -rn 's/^[Pp][Aa][Ss][Ss]=(.*)$/\1/p' | sort | uniq -c | sort -bnrk 1 | sed -r 's/\W+[0-9]+\W+//' >wordlist_ordered_whatever.txt