When one writes a noun after a dependent clause, should that noun be preceded by an "a" or an "an". "That was an, to be quite clear, extremely clever idea." Or: "That was a, to be quite clear, extremely clever idea."
No native speaker would put the article before the dependent clause in this case. In the example you give the dependent clause modifies the verb (was) and not the noun. The article should go close to the noun and after the dependent clause.
That was, to be quite clear, an extremely clever idea.
There might be rare cases where the dependent clause really does modify the noun:
The hunter's video shows a soon to be killed animal.
However this construction is clumsy and hard to understand. Most writers would use hyphens within the dependent clause.
The hunter's video shows a soon-to-be-killed animal.
In any case usual rules would be followed for deciding between a and an, which is that the next word controls which one to use
a large animal
a soon-to-be-killed animal