I'm finishing up a reading of the King James Bible (1611), which I began on January 1, and just came upon an interesting use of a relative pronoun inside a "gerund-participial clause," as PaulMatthews calls them. The syntax is not precisely analogous, in that the "relative clause," if it may be called one, is nonrestrictive and has a verb phrase as the antecedent of the relative pronoun, "which" demonstratively standing for "passing through the Red sea as by dry land":
"Which" clearly functions as the direct object of "do" in the "which"-clause. We could rephrase the "which"-clause like this: "which, assaying to do, the Egyptians were drowned." Alteratively, it could be rephrased like this: "assaying to do which, the Egyptians were drowned." And, by such contortions, we can, by extention, postulate a fairly close analogue of the construction under debate: "
They did something assaying to do which the Egyptians were drowned."