In the Star Spangled Banner, the opening line/question is "Oh, say can you see..."
Is that grammatically correct? Why isn't it "Oh, say you can see...?"
It's in the correct order.
So think of that line being punctuated as:
It's the equivalent of "Tell me, does that ... etc."
It's grammatically correct. It's like saying:
In the same way, in the anthem, "O!" is an exclamation, and "say" is being used as an interjection: