According to a local newspaper article, O'Hara's Battery has been open as a visitor attraction since May 2010.
All I can say is that in March 2011 there were plenty of posters promoting guided tours of the site and advertising a mini-bus service up O'Hara's Road from its junction with St Michael's Road, but nobody actually on the site (or, more to the point, driving a mini-bus).
However, the long slog up to Gibraltar's highest point was well worth it, as the exterior of the site was accessible and the views fantastic.
Last time I checked, 2021, I could not find any mention of the mini-bus service, and the only way to avoid the climb would appear to be as part of one of the many longer organised tours of the rock.
The battery is named after General Charles O'Hara, Governor of Gibraltar from 1795-1802. An eccentric man, he was often referred to as the Cock-of-the-Rock, not least for the attention he paid to the wives of junior officers.
He thought that, if he could raise a tower on the summit of the Rock, he would be able to observe the coming and goings of the enemy in Cadiz harbour, which is over sixty miles away. He was wrong, and his tower became known as O'Hara's Folly.
It survived until 1888 when it was demolished with the aid of a wager between the garrison gunners and the gunnery officers of HMS Wasp.
Using spars and rigging to get her guns pointing high enough, the crew of the Wasp started blasting away at the tower. After five failed attempts, the sixth shot cracked the tower from top to bottom, and they won their bet.
Shortly after that, in 1890, a 6" breach-loading gun was was installed on the site. This was replaced by the current 9.2" gun in 1901. It was originally open to the elements but in 1934 a steel shield was added to give protection against splinters and small arms fire.
It was last fired in 1976 and had a range of 29,000 yards (enough to be able hit the Africa shore).