Yes, Gijoe. It is ok. I can see why it may seem confusing, but think of it like this:
The operation was extremely fast, the period of time it took was only ninety-seven seconds, so the 'a' refers to the unstated 'period of time' (of ninety-seven seconds).
Unfortunately those are both wrong, Gijoe. This type of construction is uncommon, and I wouldn't say it's characteristic of very formal writing. It only works if there is an adjective before the number: "I spent an incredible six days and seven nights in Greece"; "In the end, he only paid me a measly fifteen dollars"; etc.
The problem with your sentence (2) is that, without the article, the number must precede the adjective: "ninety-seven stunning seconds"; "three incredible weeks"; "fifty lousy euros"; etc.