how were they chosenI'm not sure they were "chosen" exactly. Lucy Mack Smith talked about the experience, saying, "In a few days we were follow[ed] by Joseph, Oliver and the whitmers ... soon after they came they all that is the male part of the company repaired to a little grove." It was just all the men who were in the party at the time.
before I forget was the book of Mormon already published before Joseph Smith chose the 11 witnesses
The testimony is published in the 1830 edition of the book, so this occurred before it was published. The testimony itself is undated and does not name the author. Martin Harris said publicly in 1838 that none of the witnesses saw or handled the plates physically. It would be foolish to read this document as rational empirical evidence of anything that occurred in physical reality.
"I saw them [the gold plates] just as distinctly as I see any thing around me, though at the time they were covered over with a cloth." —Martin Harris, interview by John A. Clark, 1828, qtd. in Early Mormon Documents by Dan Vogel, 2:270