
According to the New York State Archives, the “Line” refers to regiments that served under General Washington, including artillery and the Green Mountain Boys. The “Maryland Line” won fame in 1775-1776 at the Battle of Long Island, where they saved the Continental Army from annihilation. The men of this regiment reorganized in 1777 and continued to fight for at least three more years. They were known for their bravery. Washington described their efforts as an “hour more precious to American liberty than any other” (Archives of Maryland Online). It was apparently Washington that started referring to the Maryland Line as the Old Line, and somewhere along the way the honorific was applied to the entire state.
 
 
A few months before his death, on 14 December 1799, Washington advised Alexander Hamilton regarding selection of officers for the army. “If Genl. Wilkinson should be promoted, it will be expected, no doubt, that the oldest Lieutt. Colo. Commandant should step into his Shoes as Brigadier; of course the oldest Major of the old line, would succeed to the vacancy occasioned thereby…”10 This letter may be the origination “Old Line” as attributed to Washington.
Although there is another theory that the nickname of the Old Line State is related to the dispute over the Mason Dixon Line, it doesn’t seem as likely to me as the regimental honorific. Many of the states’ nicknames began as nicknames for specific local groups, which were then later applied in a more general fashion to entire states. The Hoosier State is another example of this sort of generalization.
The Maryland Archives Online goes on to say:
The term “Old Line State” does not appear in the earliest histories written about Maryland, indicating that the name probably entered tradition through persistent conversational usage and a proud and cultivated regional memory.17 No source pinpoints the first use of the sobriquet beyond hinting that the name simply always existed in tribute to the Maryland Line’s reputation of honor, reliability, and valor.
Read the entire history of the Old Line State at the Maryland Archives Online