I'd argue Consecutive
I can't find a rule determining this, so I'm going to go off of what consensus in the books and my own opinion.
Most things that have a duration are meant to be consecutive. Things like long rests or casting spells have specific situations where they can be interrupted and must be tried again.
So personally I'd rule and have ruled that scribing spells has to be consecutive. Not to mention that tracking 2-18 hours "here and there" is can be annoying and will significantly lenghten the time passed before you have a new spell.
At my table
We've mainly used this ruling, simply because we don't want to track the 2 or more hours or say In 3 days you learn X. This doesn't really give us a problem since we can always find these 2 hours. Traveling on a cart, just before rest, or after. It hasn't happened often that we were so desperate to learn a spell that we needed to track it like that, just so it'd be ready for the BBEG. This may be an entirely different matter if you have high stakes based on a ticking clock.
Spells higher than first level are usually scribed during downtime or during travel. For our campaign it is quite often that we travel longer than a few days, which gives us plenty of time.
Even for a 9th level spell this'll be 18 hours, which is slightly less than a day (or 1 day and 10 hours with a long rest before and after). But again, this is mostly done during downtime.
For crafting items we use a completely different system so I can't comment on that.