The question of ethics...
I guess you should ask yourself the question, If I was standing in front of the dealer and he mentioned his price, would you have attempted to outbid him while he was watching?
I think the only thing shady was the fact that you didn't do it inside the store. Unless the dealer was a Luger Collector, he certainly wouldn't have paid a dime more for the Luger than he would have to pay to make his normal profit.
You did the kid a favor... The dealer will have to be sharper about how he conducts his business with you around...if he lets you hang around. From your description, it doesn't sound like a gunshop I would do business with unless I had no choice.
In my opinion, most gun dealers really aren't interested in buying second hand or taking trades unless they are sure they can make a bundle on the deal.
just my