I would say that it is not correct - your sentence contains a so-called "dangling participle".
The participle "shaving" refers to something which is not mentioned in the sentence as a subject or object... it could refer to the subject "his face" but that would make no sense.
"After shaving himself, he saw that his face was bleeding" would be better as then "shaving" would apply to the subject "he".
That said, your sentence would probably not raise eyebrows in some circles and would be understood from context. But it's probably better to avoid it.
You could say that but everybody would ask you “kiun li razis” (whom did he shave)?
Esperanto verbs do not have an implicit reflexive object (oneself), like some English verbs:
- to shave someone = razi iun; to shave (oneself) = razi sin
- to wash someone = lavi iun; to wash = lavi sin
- to dress someone = vesti iun; to dress = vesti sin
- to prepare something = pretigi ion; to prepare = to get ready = pretigi sin
- to bend something = kurbigi/klini ion; to bend (down) = klini sin, kliniĝi
It is possible when it refers to a given time: “li foriris marde; post tiam mi ne vidis lin” (he left on Tuesday, since then I haven't seen him).
If your question is whether “post tiam” could be used instead of “post kiam”, the answer is no. The meanings of “kiam” and “tiam” are completely different, like when and then.