mountainsoft
Thinks s/he gets paid by the post
While a sediment filter might be a good idea, be aware that (at least the ones I've seen), they are not designed to be put on the hot side
Good point! Though they do make filters for hot water also:
https://www.amazon.com/KleenWater-Filter-Premier-KWHW2510-Filtration/dp/B0167FZCP4
So you need to filter before the water heater.
That would be the better location as it would keep sediment out of the whole system, not just the dishwasher. Of course, there's no saying the sediment isn't FROM the water heater. Now you gotta replace that.
As Elbata said, fix one thing at a time...
Personally, I would just replace the dishwasher hose and call it done. It's probably cheaper to replace the valve periodically than to go to the trouble and expense of installing a filter. It just adds another maintenance item. As long as the dishwasher is used regularly to flush out the line, I can't imagine sediment being that big of a problem. Dishwashers usually only last about ten years before they need to be replaced anyway.