Federal law does prohibit you from purchasing a firearm from an unlicensed person in a state other than your own, but allows you to purchase a long gun from an FFL in any state, provided both your state and the state in which the sale occurs allow the sale.

Unless Maryland has a law against it, your friend can take the gun to a Maryland FFL and have the Maryland FFL process your transfer to you while you're in Maryland.

If Maryland has a law against that kind of transfer/purchase (which it sounds from your description like they do... ), then it'd have to be taken or shipped by your friend to an FFL in a state which will allow the sale... Virginia or Pennsylvania or Deleware or West Virginia, etc, depending on where in Maryland you are. Failing that, your friend could ship it to a Colorado FFL for you to do your background check, etc, when you get home.

IIRC, Maryland treats any semi auto rifle which can accept large capacity magazines as some kind of restricted class of firearm, and they treat it like a handgun, which might be why the MD FFL can't sell to you, an out-of-state resident. Slipping over the border to a free-er state might be in your near future.