Yes, we are doing it wrong. IMHO we are doing it wrong because our (mostly US) culture has a gun fetish and wants them everywhere.
I want my D&D games to use more elegant weapons for a more civilized age. When I'm DM'ing, doing a gun at all is doing it wrong. There are no guns at my table because of all the arguments they engender (it should have more/less range than a longbow! It should reload slower/faster than a crossbow! It should be expensive/cheap to fire! I should/shouldn't have to worry about the powder getting wet!)
My alternative is simple: "there are no guns in this setting. You can't invent one. Pick another weapon."
I don't want arguments, I want to game. I don't want guns - I can play with those today. I can't easily use spells and medieval weapons on my friends. If I wanted guns, I'd go play laser tag. Or airsoft. Or a million other things. I play D&D to get away from guns.
(Don't get me started about City of the Gods or Expedition to the Barrier Peaks or similar - if I want Sci-Fi, I'll happily play sci-fi but keep your darned sci-fi out of my fantasy, thank you!)
EDIT: Also, get off my lawn!
This. So much this.
(and get off my lawn, too!

)
I am amused at this pair of statements, given that there is nothing more old school that mashing genres and infusing fantasy with weird.
Sure there is, the "older than old school" is NOT infusing fantasy with sci-fi elements. Those came a bit later. Pure medieval magical fantasy was where it all began as an RPG.
Of course, the key point is also to specify wanting D&D as "medieval magical fantasy" since sci-fi
IS a form of fantasy as well.
Honestly, the whole 'guns don't belong in my medieval fantasy' thing is a pet peeve of mine. Guns are medieval weapons. Late medieval, but so is plate armour, and heaven forfend if you try to remove that. On the other hand, you have things like rapiers, which are strictly early modern weapons and have no place in any kind of medieval setting. The reality is that 'no guns' is just a D&Dism that has nothing to do with history.
Depending on the setting, I've seen a lot of DMs remove plate armor as too "late" medieval for their game.

And most I know don't allow rapiers at all. I know I never do. For most games, the inclusion of plate armor times with a hand cannon (definitely a one and done weapon) is borderline acceptable IME. Later "guns" such as the arquebus were never allowed. When 2E introduced it to the game, a lot of people rebelled against its inclusion.
Quick timeline:
Plated armor (about 1250)
Hand cannon (about 1300)* corrected for type-o.
Full plate armor (also about 1400)
Arquebus (about 1475-1500?)
So, concerning (full) plate armor (5E) and arquebus, both are late medieval, and honestly about equally rare (hand cannons were just not that common as people initally feared powder, and plate was expensive!). By the time the arquebus came out, the fear over powder was pretty much gone.
However, to the OP:
- Muzzleloaders should be one and done weapons. Reloading them would take several rounds (minimum of 3 or 4), so dropping them for a different weapon is easiest. We treat heavy crossbows in particular as one and done weapons as well.
- Range would be long, like 1500 feet or better. I'd probably list a "rifle" range as 300/ 750. Technically, they could fire twice this range but keeping it at 750 would be more in line with how WoTC cut the range of longbows in half. Pistol range would be much shorter, maybe 100/ 300 or so. Although the fps of a bullet or shot was MUCH faster than an arrow or bolt, early guns were also notoriously inaccurate! While I might suggest an attack roll bonus given the speed, IMO it is negated by the use of smooth bore instead of rifled, so net becomes no adjustment.
- I like @Shiroiken's idea of having it defended by making a DEX save instead of an attack roll, so that is another option.
- Damage SHOULD NOT be ridiculous, but should be very good. I know people love the idea of giving guns great damage because people think they are so lethal, but you are more likely to survive a gunshot than just drop dead from it. Probably d10 for pistols and 2d6 for rifles.
- Finally, I would give them their own weapon property knockdown. Medium or smaller targets hit must make a STR save (DC = 8 + your attack bonus) or be knocked prone. Large creatures would have advantage on the save. Huge or larger don't make a save.
The idea of treating firearms as a martial cantrip is particularly interesting to me. Damage of d8/d12 would be very good, a kin to
toll the dead, and the STR save to avoid knockdown would be a good rider. Allowing damage to scale with level (like other cantrips), keeps guns effective at higher levels.
Other options would be to have targets be
stunned until the end of their next turn when hit (or failing a save). Given how load firearms would be, having other options to deafen or frightening targets make sense IMO as well.
While I'd never use guns in my D&D games (maybe the hand cannons on occasion...), it is an interesting discussion.