updating/inserting int the aggregate table should be straight forward:

select order_number,

sum(options) over(partition by order_number order by order_number) options_price,

sum(unit_price) over(partition by order_number order by order_number) total_price

select order_number, case when option='N' then 0 else unit_price end options, unit_price

from table1

)