- Marko: Mi volas roli kiel soldato.
- Polo: Tio estas bona / bone
Since tio is an -O word then should it be bona? Or, since the word tio is referring to a verb (roli), should it be bone?
It should be "bona", because it modifies/belongs to "tio", which acts like a noun. So your first guess was right. :)
In choosing whether a modifying word should be an adjective (a-word) or adverb (e-word), it only matters what kind of word it modifies. What that word means or refers to is not important.
By the way, you can see something similar in English with "Anna is a good teacher" (Anna estas bona instruisto).
Having just learned the difference between adjectives and adverbs, English learners who don't have such a strong adjective-adverb divide in their native language are sometimes inclined to say "Anna is a well teacher" (Anna estas bone instruisto), because "good/well" is about the teaching (instrui), not about Anna herself.
But the meaning of the words are completely unimportant when it comes to basic grammar. You say "good / bona" simply because it belongs to the word "teacher / instruisto", which is a noun. That is all that's important in this case.
Tio isn't quite an o-word. It's a correlative and they follow slightly different rules. Still, the correlatives ending in O do have o-word-like qualities. They will take an -n ending and are described by adjectives. The biggest difference is that they don't take a plural -j.
In a sentence without tio you would use an adverb: