Since you have completed your term ie 39weeks pregnant, dont worry at all. Having lower abdominal pain
which comes and goes indicates your are having uterine contractions. Brownish discharge mixed with mucous is called "show" which you are having. All these are signs that you are going into labour. You also said that you underwent an internal examination by your doctor , and at times sweeping of the cervix
is done during internal examination which prevents a patient from becoming post dated(delivery beyond 40weeks).
Its good if you are going into labour now as you are already 39weeks. All you need to do is keep a record of baby movements, the number and intensity of pain(contractions) you are having.If your pain gets severe, more regular in frequency and you feel your abdomen is getting hard with the pains then it means you are having contractions and you should visit your doctor. Also keep a pad applied and look for the discharge. IF watery fluid gushes out of your vagina (means your bag of membranes has ruptured and amniotic fluid
coming) or you have frank bleeding, you should see your doctor at once.