The haul was discovered when police searched 51-year-old Ross Learmonth after being called out by concerned members of the public.
The High Court in Glasgow heard on Friday that Learmonth was incoherent, unable to communicate and appeared drunk.
He insisted he had only had a couple of beers, but a search of his trousers and jacket revealed two bags of heroin.
Learmonth, who has a number of previous convictions for drug offences, admitted being concerned in the supply of heroin at the A883 road close to Checkbar roundabout, Denny, on October 19.
Prosecutor Shirley McKenna said: “At 4.30pm police officers were advised that a man was staggering in the middle of the A883, close to the roundabout.
“Officers found the accused lying on the path under the motorway flyover.
“They noted he was incoherent, unable to communicate and appeared intoxicated.”
The court heard that police found a block of heroin in the his right hand jeans pocket and a bag of heroin in his jacket, along with £130 in cash.
When the drugs were discovered Learmonth, who is a prisoner in Low Moss, Bishopbriggs, told police: “That’s my heroin.’
Judge Lady Rae told Learmonth: “You have an appalling record, involving drugs and other offences. You have 43 separate convictions. However, I realise you would not be in the High Court were it not for your appalling record.”
She jailed Learmonth for five years and seven months and said that, but for his early guilty plea, she would have jailed him for seven years.
Solicitor advocate Gordon Martin, defending, said: “He has substantial drug problems. He and his girlfriend are heroin addicts and he says the drugs found in his possession were for their use. In his favour no tick lists were recovered.”