The pattern of cough, increased while inactive or laying down and then disappearing while walking is normal with CHF. The heart rate increases with exercise and blood flow increases. When heart rate slows, gravity takes effect and fluid tends to accumulate in the lungs causing the cough.
The medical treatment you are doing is really the best available. The medicine undoubtedly is working, it's just that her heart is damaged to the point that it's not able to always provide adequate circulation. Unless there has been a change in her heart and another condition has added to the CHF, there really isn't much more that can be done.
The coughing spasms or spells are not really painful. Distress comes when they can't breath fast enough or deep enough to provide the minimum oxygen needed. Most dogs in this situation will sit (provides the greatest ability to fill the lungs), extend their head and just pant.
Knowing the exact time is hard for any of us not with her on a daily basis to offer an opinion. It has been my experience that the dogs will tell us when they have had enough, usually a drastic change in behavior. Sometimes they tend to go off by themselves. Sometimes get clingy. Many stop eating. I guess if the coughing spells become frequent enough that they bother her or she get to the point where she can't go for walks or do any routine activities, it's time.
Doug, DVM