A gunman and his accomplice shot a man through a front door amid a spiralling “feud” before fleeing to Scotland, a court has heard.