im actually kind of skeptical about how innocent this guy really was. He might have really had a real gun on him because some one was out to get him, ie. his bookie, his mistresses husbanc ect. and he thought that you were someone else when he answered the door. Even if he had a fake gun he was probabaly using it to scare off someone he expected to come to his house to threaten him. I answer the door with a gun in my possession sometimes, but i dont EVER make it visible usless im shooting at someone with it, which doesnt happen all that often. that plus... i dont owe any drug dealers money.
Long story short, that guy sounds like a turd bag and i would have involved the cops so they could get all up into his personal life and discover why he needs to answer the door with a gun.
Additionally if you didnt call the cops and stand up for yourself, hes just going to do this stupid shit again to some other poor delivery guy. The paperwork might take all day but its worth it to show guys like this that they cant pull guns on anyone they want regardless of wether theyre real or not!