Person B could omit "a" before pen. This is common.
In the last sentence, you have used the plural verb "were", so you clearly regard them as two distinct items. Give each of them an article. If they formed a set, a single item, then you would say "There was a book and pen on the table".
You can omit it, but this isn't at all the same situation.
In your original sentence, you were mentioning the book and pen for the first time. The indefinite article serves as a form of introduction to the items, and it is better to give each its own introduction, and particularly so when using "there are..."/"there were..." where readers expect to be introduced to things.
"The" might be used for things that have already been mentioned, so this degree of care is not needed, even with singular nouns. In your new sentence "the" has a different use, meaning all of them, or the people in general. It is usually taken to apply to all the nouns that follow, unless some other term is used to indicate otherwise, such as "The teachers and most of the students...".