If your window1 contents come from a file or another window, you might as well issue a filter there immediately, making a second window obsolete.
Suppose it's coming from a file, you'd do
window -h @@
filter -fkg myfile.txt myalias <regex pattern>
alias myalias aline -n @@ $$1
Nevertheless, I think it's a good suggestion, and I would like to see it added, especially when working on large files, where you'll get less overhead if this anti-duplicate routine is coded internally.