Some thoughts on rights, law, and moral authority...
Given the situation described by the OP, did he do right? Sure. Everything was handled, with neither escalation of the situation, nor hostility.
Was he right to do as he did? That's a different question. Lets look at it this way, cop comes to the door, investigating a complaint. You answer the door armed (As is your right). And (unless the law requires), out of courtesy you inform the officer you are armed. That is just simple common sense.
The officer cannot be certain just what he is walking into. He probably expects something ranging from calm discussion to an angry parent. Surprising him with a gun is a rather poor idea.
But you are in your own home, doing nothing illegal, and you don't have to do xxxx! True, under the law, BUT somethings are just good ideas, even when not required by law.
By asking the officer how he wanted things to proceed, the OP implies he will do as the officer asks, without objection. THis places the officer in control of the situation. Its a good way to avoid misunderstandings, BUT the officer may want you to do something you object to, or that you feel violates your rights. If he does, what then? You have already indicated that you agree he is in control, and refusal to obey instructions can trigger an undesirable reponse on the part of the officer, as he takes what steps he feels needful to retain, or regain control of the interaction.
There's no reason not to discuss things like adults, you do have rights, after all. BUT, after you indicate you will comply, not doing so is a very poor choice.
One can be respectful of the officer, and still be firm in asserting your rights. But there are limits to everything. Behaving as a calm rational individual gets you a lot further than anything else. If you get confrontational, and push things to the point of action/reaction (and you can do that verbally with some people) then you will lose more than you could gain. Possibly everything.
Sure, you have the right to tell the jack-booted thug in uniform he can't come in without a warrant. You can even tell him you will disarm when he takes it from your cold dead fingers. But if you go that route (even mildly) you are going to regret the outcome, most likely.
I know, I'm using extremes to illustrate my point, but really, how does it damage our rights and liberties to be reasonable and courteous. even if (or perhaps especially if) they are not being as well mannered as you are?
The officer may not have a choice on his reaction, there may be a dept policy about what he is required to do, when you inform him you are armed. Ever think of that? He might not be out to humiliate you and deny your rights, he might be just doing his job the way he is trained and required to. And most assuredly, thats the way he's viewing it, just doing his job.
There are all kinds of shades of grey involved, just as there are all kinds of individuals involved.
If you think an officer has gone overboard in his handling of a situation, complain to his supervisor, and on up the bureaucratic chain, if you need to. But do it afterwards, when everyone is calm, and (hopefully) rational.