I hear this alot and I think it's just a myth and based off old ideas in skincare. Pores don't really open or close all that much.
What I really think happens is when you use shaving soap, it over-hydrates the outermost layer of skin and alters the protein structure, softening it, so that the barrier function of the skin is damaged (which is why people with sensitive skin might notice their skin becoming more sensitive when using shaving soap, the skin's nerves are more exposed to irritants). Using an aftershave with astringents dehydrates this outer layer and alters the proteins, hardening them and helping to restore the skin's barrier function.
What I really think happens is when you use shaving soap, it over-hydrates the outermost layer of skin and alters the protein structure, softening it, so that the barrier function of the skin is damaged (which is why people with sensitive skin might notice their skin becoming more sensitive when using shaving soap, the skin's nerves are more exposed to irritants). Using an aftershave with astringents dehydrates this outer layer and alters the proteins, hardening them and helping to restore the skin's barrier function.