John Smylie, 45, was being taken to the cells in Livingston when he pulled the reckless stunt.
He had earlier been arrested for a string of motoring offences after worried motorists reported him for drunkenly ramming his red Volvo into the back of a taxi then driving off and hitting a lamppost.
He was still trying to drive away when police arrived at the crash scene, but his car's airbags had inflated and got in his way, Livingston Sheriff Court was told today.
Smylie, from Broxburn, West Lothian, pled guilty to culpable and reckless conduct to the danger of life and showing utter disregard for the safety of the police car's occupants.
He also admitted driving without insurance on the A801 near Whitburn, West Lothian, and failing to provide two breath specimens at Livingston Police Station on September 29.
Sheriff Martin Edington fined Smyllie 765 and banned him for driving for two and a half years.
The sheriff also ordered him to carry out 135 hours of unpaid work.
He said: "Instead of depriving you of your liberty I'm going to make you put something back into the community.
"This was a very dangerous offence indeed."
John Barclay, prosecuting, said police officers found the accused heavily under the influence of alcohol.
When they asked if he was the driver of the crashed car he replied "I don't know".
Mr Barclay said: "He was placed under arrest and, as he was being conveyed to the police station in the back of a marked police vehicle going at speeds of around 70mph, the accused reached over and for no apparent reason opened the rear nearside passenger door.
"He was restrained by one of the constables, the door was closed and they arrived at their destination."
Andy Aitken, defending, said the case was "bizarre in the extreme".
He said: "He accepts that his behaviour in the police vehicle was extremely reckless. He hadn't actually expected the door to open.
"I think it's fair to expect that if you're a prisoner in the back of a police car the door wouldn't open from the inside.
"He appreciates that he endangered the police officers in the car and other road users. His position is the door was open for a very short time and he closed it himself."