The first "vagy" is a verb, present tense, 2nd person of "to be" (te vagy). The second "vagy" is a conjuction, equivalent to "or" in English. So these two words are just homonyms, i.e. they have the same spelling, but different meaning.
February 9, 2019