You can try something else. While it’s not ‘automatic’ it might be a better and cleaner solution.
First, draw a regular stroke to the size, color and thickness that you like. Then add to it an object style that has the Anchored Object Settings set so when this object is anchored anywhere it will be placed in the exact fixed position that you want. (It helps if you first anchor it into the headline text, and then play around with the Anchored Object Settings while the Preview check-box is on.)
Now put away the stroke on the pasteboard.
When you’re document is done, and all the headlines are ready, copy the stroke (with the object style applied to it) to the clipboard (cmd/ctrl c). Then open up the Find/Change dialog box (cmd/ctrl f) and select the ‘GREP’ option. In the Find What field enter: ^(.) which means ‘find the beginning of any paragraph’. Then in the Change To field enter: ~C$1 which means ‘and then paste and anchor into that space anything that is on the clipboard’. Don’t hit ‘Change All’ yet, or you’ll have a party of line on every paragraph of your document…
Then in the bottom by the Find Format option, press the small icon to the right (the one with the T and the magnifying glass), and in the dialog box that pops up select the “Header” paragraph style. Hit Okay, and then hit Change All. You should now have the stroke appear below every Header line.
If the position is off, just edit the Object Style to fix the Anchored Object Settings. The same goes if you decide to change the thickness, color or any attribute from the stroke.
Just one thing, I’m not sure if you can edit the size of the stroke thru the object style. So that if you decide to change the length of the stroke you can’t do that in Object Styles. Maybe I’m wrong, but I think that you can’t.
But to that problem I thought of a workaround. Instead of creating a stroke, create a text box the width of the spread. Enter one character, any character, and give it a color of [None]. Then add a paragraph rule with the width, thickness and color that you like and save it as a paragraph style. Then take this text box and add an object style with the same anchored object settings as the stroke above. Place on pasteboard, and follow the same steps as above to paste it thru Find/Change in all the headers. But this time if you want to edit the width of the stroke, just edit the paragraph rule options in the paragraph style that you created it for that, and walla!
Hope this helps, if I wasn’t clear enough, don’t hesitate to ask…