(The). 1708, when Queen Anne went to St. Paul's to offer thanksgivings for the victory of Oudenarde. The tale is that the plotters took out certain screw-bolts from the beams of the cathedral, that the roof might fall on the queen and her suite and kill them.
`Some of your Machiavelian crew From heavy roof of Paul Most traitorously stole every screw, To make that fabric fall; And so to catch Her Majesty, And all her friends beguile.
Plot upon Plot (about 1713).
Source: Dictionary of Phrase and Fable, E. Cobham Brewer, 1894
More on Screw Plot from Infoplease: