What do the words "wobei" and "dabei" mean? And what is the difference in their usage?
Sie gab mir das Buch, wobei sie vermied, mich anzusehen.
Sie gab mir das Buch, dabei vermied sie, mich anzusehen.
Do they mean ' at the same time' ?
There is no semantic difference in your example, but consider this one:
Wobei only states that things are happening at the same time, dabei can also imply that the second action is a consequence of the first one. Therefore, dabei is preferable in this case. Be aware that this is just a weak additional meaning, the main meaning still being “at the same time”.
Both words are equally formal. Colloquially, wobei can also be used to state an objection or relativization:
Edit: As Emanuel pointed out, while Duden claims this is colloquial, it is also used in written language. I changed the example to a better one he gave in the comments.
Consequently, your first proposal is grammatically correct whereas your second proposal has a slight grammatical error: The two sentences
But you can and for the sake of simplicity should keep both sentences separate: