I posed this question to a great Rabbi in Jerusalem, whose specialty is financial law, and he ruled that the $200 returns to your friend. He will certainly be happy, and may even offer you to keep part or all of the money since it was your “work” that succeeded in saving this amount.
The Rabbi explained why according to the “letter of the law” the money belongs to your friend. Your friend never relinquished ownership of this money; he merely entrusted it with you. You didn’t spend it on the carpet, so it goes back to you friend.
Now, if things had been slightly different, you would have profited according to the letter of the law. If, instead of a lower price, you would have received extra carpeting as a result of your bargaining, the additional amount would be split between you and your friend.
The difference between these cases is as follows: In the first case, the point in question is the extra money. Since your friend is the original owner of the extra money, and he never relinquished his ownership, he gets it all. In the second case the point in question is the carpeting. Neither you nor your friend is the original owner of the carpet.
So who gets the extra carpet in the second case? Although the intention of the seller was probably to give it to your friend, the early Torah Sages decreed that the original owner of the money split the “bonus merchandise” since both parties were responsible for acquiring it.