STAMFORD — When a woman came to Stamford police in October with a complaint that she had been sexually assaulted by her therapist four years earlier, investigators did something right out of a television script. They outfitted the woman with a hidden electronic listening device and sent her to her therapist’s office on West Main Street.