Perhaps I misunderstand your question, but generally (observed) selection bias is tested by comparing the baseline characteristics of the treatment and control groups using the appropriate test statistics. If you assume there is unobserved confounding and/or selection bias, you can use bounds to test the magnitude of the unobserved bias that would nullify your findings. I am not sure if this test has been extended to longitudinal data, but you could collapse/stack your data and test it that way.