Are you trying to store Series info in the Title
Calibre has a Series field for that and a series_index for the sequence number(displayed in the square braces after the series name in Library view).
Bulk Metadata Edit (main tab) has a tool that can be used (with care
) to sequence WITHIN a series.
Lots of if's and 1 series at a time
Then there is the search and replace tab. Your Replace is rather tricky, so I would copy (a right click function on selected books) a batch of books to a 'test library'
and work until you get it right. You are dealing with multi-field replace(fill)