A court has heard how a man caught with 28 bags of crack cocaine was not a street dealer but was instead operating as “a mobile storage unit” to pay off a drug debt.