For copying header fields to line fields, there should be a method like initFromYourHeaderTable in your lineTable, you have just to add somthing like this:
YourLineField.YourField = YourHeaderTable.YourHeaderField, each time a record is created in lines, the header value will be copied.
For copying header updates to Line fields, you have the hard way in the following link : http://axforum.info/forums/showthread.php?t=24216, it’s in russian but the code is quite clear, it shows how line fields are automatically updated when header fields are modified. You can do the easy way with adding a modified method() on header form datasource fields, that updates lines corresponding.