There’s a perfectly good solution to this problem in Smyth, sec. 2354. εἰ with optative after secondary tenses can be used to mean “on the chance that,” “in case”. “I composed the poems . . . in fulfillment of a sacred obligation–in case the dream visions were instructing me to compose this sort of poetry.” Smyth writes: “The protasis here depends, not on the apodosis proper, but on the idea of purpose or desire suggested by the thought.” I think this must be the right solution–and it also accounts for the use of the optative in the later passage and the use of the indicative, rather than the optative, in τί λέγει.
In fact, that’s the way I read the sentence when I originally looked at it, and that’s the solution I first thought to offer. What led me astray–and induced me, I fear, to lead others astray–was the note appended to this section of Smyth: "This use is to be distinguished from that of εἰ ἄρα if perchance . . . " I don’t see why ἄρα can’t be inserted in the “in case” construction, or why Smyth suggests that the two usages are mutually exclusive (if that’s what he means). I should have followed my own advice about not relying too heavily on grammars. (But I think that Smyth is an indispensable resource.)
I apologize for wasting everyone’s time. Maybe this is a good lesson in not taking too seriously what you read on the internet.