What does “the word of God and testimony of Jesus Christ” refer to in Revelation 1:2?
I would say that “the word of God and testimony of Jesus Christ” refers to prophecy.
Revelation 1:9-10 New International Version (NIV), helps the reader to understand my reasoning.
I, John, your brother and companion in the suffering and kingdom and
patient endurance that are ours in Jesus, was on the island of Patmos
because of the word of God and the testimony of Jesus. On the
Lord’s Day I was in the Spirit, and I heard behind me a loud voice like a trumpet.
The above text informs the reader that John was on the island of Patmos because of the word of God and the testimony of Jesus and also refers to John being "in the Spirit on the Lord's Day". After this he heard behind him a loud voice like a trumpet, he was told by the angel, Rev 1:11
11 which said: “Write on a scroll what you see and send it to the
seven churches: to Ephesus, Smyrna, Pergamum, Thyatira, Sardis,
Philadelphia and Laodicea.
John does what he is told to do by the angel and begins to compile the book of Revelation - a prophetic book. Further on in the book John has a conversation with the angel which is recorded in Rev 19:9-10,
Revelation 19:9-10 New International Version (NIV)
9 Then the angel said to me, “Write this: Blessed are those who are
invited to the wedding supper of the Lamb!” And he added, “These are
the true words of God.”
10 At this I fell at his feet to worship him. But he said to me,
“Don’t do that! I am a fellow servant with you and with your brothers
and sisters who hold to the testimony of Jesus. Worship God! For it is
the Spirit of prophecy who bears testimony to Jesus.”
I think it is clear to see from the above text that John was "in the Spirit" in the same way as recorded in Rev 1:10 when he was "in the Spirit on the Lord's Day", and at both times, being in the Spirit enables John to see, hear and write future events. In short, he writes a prophetic book namely Revelation. John has become a prophet. His prophetic gift is further established in another conversation with the same angel in Rev 22:7-9 where it is written,
Revelation 22:7-9 New International Version (NIV)
7 “Look, I am coming soon! Blessed is the one who keeps the words of
the prophecy written in this scroll.”
8 I, John, am the one who heard and saw these things. And when I had
heard and seen them, I fell down to worship at the feet of the angel
who had been showing them to me. 9 But he said to me, “Don’t do that!
I am a fellow servant with you and with your fellow prophets and with
all who keep the words of this scroll. Worship God!”
In the above text (bold) it is clearly seen that John is referred to as a prophet.
In your question you ask,
It seems rather certain that in 20:4 the phrase there does not refer to Revelation. And it seems likely in 1:9 that it is also not the case (it is possible to read it as he was on Patmos "because of" in the sense of "in order to receive", but this seems unlikely). What does it refer to in 1:2?
I would say that your observation is correct and that John was on Patmos in the sense of "in order to receive".
We know that John held to the "Testimony of Jesus", and we also know that the Testimony of Jesus is the Spirit of Prophecy and John did receive prophetic information whilst he was in the spirit on Patmos, because of the word of God and the testimony of Jesus.