Now, before I do all of that, I want to know what I'm going to get into, or to generally ask if anyone has tried this before; how do Crossbowmen/Ranged units behave when you assign them a melee weapon, on top of their main ranged weapon?
The short answer would be that if you give them a mace and a crossbow, they will attempt to fire all the bolts then attempt to melee using the mace in one hand and the crossbow in the other.
The longer answer would be that military dwarfs will carry handheld items on their belt/torso when they are off-duty, and will attempt to put them in their hands when they are on-duty, but if you assigned three handheld items to the uniform (like mace, crossbow, and shield), then they will attempt to hold only two of those items and they will not choose the "better" choice. It is possible for a dwarf to hold three items, but that seems to be related to the bug that results in dwarfs becoming deadly with
figurines. That being said, it is better to assign them two handheld items because the bug is difficult to exploit, so assign them the crossbow and either a shield or a melee weapon (I prefer hammers over maces because crossbow-bashing trains the hammer skill).
Do they simply charge into battle prioritizing using their melee weapons? Or do they actually use up their bolts first, THEN go into battle? I believe I read in some places on the forum in the past that Crossbowmen charge in blindly, no matter what, even if they have no melee weapon at all and just were assigned crossbows. People had to build enclosed towers/pillboxes with fortifications to stop crossbowmen from charging, who did so even when they had a full quiver of bolts available. Is this still the case now?
Currently they seem happy to use up their bolts first then choose another action based on line-of-sight and pathing options to reach the target. Some players put their marksdwarfs on Patrol, so when the dwarf in the tower is out of bolts, they refill ammo instead of pathing to fight in melee.