Stefan Diamond, 21, of Wilson Place, was brought the mask by a friend and, after showing it to his brother, was "encouraged to go to the local shop" where he "thought he would play a joke", Andrew Mellor, Diamond's solicitor, told Haddington Sheriff Court last Wednesday.
Diamond arrived at the Co-op on High Street on May 3 wearing the mask and brandishing a cardboard gun. Although he didn't enter the shop he was "hovering round the entrance", Mr Mellor said.
Diamond pleaded guilty to conducting himself in a disorderly manner, pointing an item resembling a gun at staff while his face was concealed, placing staff in a state of fear and alarm and commiting a breach of the peace.
Alison Innes, procurator fiscal depute, held up the cardboard gun - which she described as "pretty pathetic".
It had 'property of Osama Bin Laden' written on the back. The textured rubber mask was "pretty lifelike". the court heard.
Sheriff Peter Anderson asked if the incident was committed "before or after [Bin Laden] was visited by Navy Seals" but stressed this was a "serious matter" and deferred sentence for background reports.
He deferred sentence until June 29 for reports.