Giving a rare insight into the thinking of a putative director in the 17th century, an “extraordinary” annotated copy of Ben Jonson’s gender-swapping play Epicene has been saved for the nation by the University of Edinburgh.

Printed in 1640 – around 30 years after Epicene was first performed, and three years after the death of the English playwright – the collection of Jonson’s plays, titled The Workes of Benjamin Jonson, was placed on the market last year. An overseas buyer had placed an offer on the collection, but its cultural significance meant that an export bar was imposed on the book by the UK government, with British libraries given the opportunity to acquire it first if they could meet the purchase price of £48,000.

Supported by the Friends of Edinburgh University Library, the Friends of the National Libraries and the John R Murray Trust, the University of Edinburgh purchased the collection last week.

Scrawled in the margins of Epicene, a 1609 play in which an old man is tricked into marrying an apparently silent woman who turns out to be a boy, are details that reveal, for the first time, how the play might have been performed in the 17th century. Epicene is the only play in the collection to be fully annotated, with experts claiming that no other editions of Jonson’s works that show how they were once performed remain in existence.

The margins of Epicene in the 1640 book. Photograph: The University of Edinburgh

“The swords layd by at one side, drawn,” notes one stage direction, while others stipulate, “The Ladyes look towards the dressing room” and “Dauphine all this while seemes whispering to Clerim[ont]”.

“It shows the directorial imagination – someone reading the play, quite possibly with a view towards a professional production,” said professor James Loxley, a Ben Jonson scholar at University of Edinburgh. “It shows how you get from the bare lines on the page to a fully rounded production of the play – the movements of the characters, what they’re doing when they’re not speaking.”

Loxley said that very few printed texts of plays from the 17th century were marked up to perform. Instead, actors would have worked from playhouse manuscripts, or prompt books, which “got used to death” and have since perished. Some plays would have made it to the printers, “usually for readers with an eye on a future production”, but “these printed texts didn’t place an emphasis on stage directions – all that was left out”.

Edinburgh University holds a number of Shakespeare prompt copies, showing indications of how the plays were performed at the time of printing. But Loxley, who believes the Ben Jonson annotations are likely to date to post-1660, after the Restoration, said that the edition was the only surviving marked-up copy of a Jonson play.

“We just don’t have that, even though Jonson was the more popular playwright during that period. This is completely unique,” he said. “It gives an insight into how people thought about Jonson’s comedy during that period ... it is the most extraordinary addition.”

Joseph Marshall, head of the Centre for Research Collections at the university, called it a “landmark collection of works”.

“Some 400 years ago, Jonson famously walked from London to Edinburgh, meeting Scottish poets such as William Drummond on his travels. Now this remarkable volume is making the journey north, too,” he said.