Jolly1 - thank you for joining the discussion.
While rifles were certainly more expensive to manufacture than muskets, it was not the cost that was the determining factor in the limited use of the rifle. Rather, we must remember that linear tactics evolved from earlier warfare where masses of pikemen were supported matchlocked armed infantry. As pikes were phased out in favor of firearms, the linear formations remained. Gradually, the density decreased until by the Napoleonic era the British formation was only two lines strong.
Why the retention of the linear formation? It was believed that battles were won by massed firepower which would demoralize the enemy and render him vulnerable to the bayonet charge. Volume of fire and not accuracy was seen as the winning factor. Accuracy wasn't needed since if a soldier missed his opponent in front of him, there was always another one each side! Riflemen were seen as too independent and out of an officer's immediate control. It was believed that soldiers were brutes and needed supervision of an officer and this was another reason for maintaining the linear tactics into the era of the minie ball.
However, starting in the mid-1700s, some nations began issuing rifles in limited numbers. The rifle armed soldiers were specialists and many of the principalities of the Holy Roman Empire formed them into jager units. These units may be traced to the grenzers (border troops) of the Austro-Hungarian Empire that practiced ambushing the Ottomans from positions of concealment. The Ottomans of course returned the favor and I know they certainly did it to the Maltese and the Knights Hospitallers (Knights of Malta) during the Siege of Malta (1565). Returning to the Austro-Hungarian Empire, they introduced it to the rest of Europe and soon many of the German principalities/duchies/kingdoms of the Holy Roman Empire had their own Jager units. So did the Poles and the Russians who also adopted the green coat the rifle for their jagers.
Even after the American Civil War, the inter-European Wars still saw the use of linear tactics. The Austro-Prussian War certainly had it and it was the last time the muzzle loading rifle musket was used in widespread numbers by one side in Europe. The Franco-Prussian War also saw linear tactics being used by both sides.
Vigilantibus et non dormientibus jura subveniunt. Molon Labe!