256. Reciting Shema While Exempt
Kriyas Shema 4:6
After the deceased has been buried, the mourners return to receive condolences. The rest of those present follow them from the grave to the place where the mourners form a line. If they are able to start and finish even a single verse of Shema before they reach the line, they should do so. If not, they should wait to recite Shema until they have consoled the mourners. After departing, they continue reciting Shema. Those in the inner line – meaning the ones who can see the faces of the mourners - are exempt from reciting Shema. Those on the outside, who cannot see the mourners, are required to recite Shema in the place where they are.
Kriyas Shema 4:7
If a person is exempt from reciting Shema but he wishes to act stringently and recite it anyway, he may as long as his mind is not preoccupied. However, if he is in an agitated state, he is not permitted to recite Shema until he has regained his composure.