To understand this stanza of Keats' "Ode to a Nightingale" you have to go back to the beginning and understand what he says he is going to try to do in creating this poem. He is feeling very depressed because he knows he has tuberculosis and will soon die. He wishes he could use something to deaden his consciousness so that he could forget about his fear of death and the fact that he will not be able to realize his ambitions to write all the great poetry he feels capable of creating.
In the first stanza he mentions "hemlock," a poison, and "a dull opiate," a powerful drug. In the second stanza he wishes he had a big beaker of wine
That I might drink, and leave the world unseen,
And with thee fade away into the forest dim.
Escape is what he wants. He wishes he could be like the nightingale he hears singing nearby, which would be another form of escape from himself and his unhappy thoughts. Finally in the fourth stanza he decides, since he has no wine, that he will escape in his imagination by creating a poem in which he actually flies to join the nightingale, and he succeeds in doing so.
Already with thee! tender is the night . . .
(F. Scott Fitzgerald used Keats' "tender is the night" as the title of his best novel.)
In stanzas 5, 6, and 7 he imagines what the world of the nightingale is like. At one point he mentions wine again:
And mid-May's eldest child,
The coming musk-rose, full of dewy wine,
The murmurous haunt of flies on summer eves.
In the seventh stanza, his vivid imagination carries him far away. He says that the immortal song of the nightingale is the same song that has
Charm'd magic casements, opening on the foam
Of perilous seas, in faery lands forlorn.
He has succeeded--though only momentarily--in escaping from himself and his sorrows through poetry, but he cannot sustain the illusion he has created. The word "forlorn" first appears at the end of stanza 7 and then is repeated at the beginning of the eighth and last stanza.
Forlorn! the very word is like a bell
To toll me back from thee to my sole self!
The word "forlorn" sounds to him like the two notes of a clanging bell. A bell swings one way and the clapper strikes one side, sounding a dull tone. Then the bell swings back and the clapper strikes the other side, sounding a similar dull tone. Keats is using the imaginary sound of the bell to signal the beginning of the end of his poem and of his excursion into the world of the nightingale via his poetic imagination. He acknowledges that he does not have the power to escape permanently from his unhappiness through poetry. He says:
Adieu! the fancy cannot cheat so well
As she is famed to do, deceiving elf.
Perhaps the nightingale to whom he has been addressing his poem has started to fly away. He bids the immortal bird adieu and comes back to his senses and his sorrows, asking himself
Do I wake or sleep?
There is a "poetic conceit" running throughout the poem. He is pretending that the nightingale he hears singing in the shrubbery is immortal because, like most species of birds, it always sings the same notes, or the same "song." Immortality appeals to Keats because he is certainly dying and wishes it were not so. He is in love with a young girl but cannot marry her. He has dreams of writing many books of poetry but will never be able to complete them. The fact of death, at such an early age, is inescapable. He died in Italy not long after composing his poem to the nightingale he listened to in the garden.