When do damage-over-time and healing-over-time effects calculate their effect?
Solution 1:
According to the 'Basic Mechanics' thread on sithwarrior.com opportunity to critically hit and the damage done is recalculated each time a DoT/HoT ticks.
Under 'Debuffs and DOTs'
- Periodic abilities evaluate a person's buffs on each tick and not just on the initial cast.
That would seem to answer your first question as no, it isn't set at the time it is cast. And then yes, it is dynamic.
The answer to the 'put another way' question is significantly harder in my opinion. There are some cases where it would be optimal to pop the buff before casting, and other times where it perhaps doesn't matter. Any ability with an initial surge is going to benefit from the buff.