Many dogs tend to urge reflux if they're going too long between meals, and as they become old this may become an additional noticeable downside.
If this were my dog, I feel I would attempt to move his feeding time; presumably feeding him nearer to time of day therefore there is less time between feedings. If he goes to bed at 10:30, strive feeding him a couple of food at around ten. This may offer him enough time to urge back outside to crap if he has to before you all quiet down for the evening.
Hopefully this may watch out of the matter, however if it does not, then you'll need to speak to your vet concerning beginning him on a Pepcid-type medication to presumably keep the coughing in check if this can be a reflux quite factor.