judging by what you have there, i don't think that i explained it correctly.
1. open /etc/postfix/virtual (which is arranged as above)
2. seek to the line that begins with the same value as $dom
3. do a return at the end of that line and print $user\@$dom\t$user
Hope this is clearer. (i'm crap at explaining).