Thanks again.

Since I had a little spare time today at work, I had another go at it. Here is how I figured out how it could be, I'm posting this here in case anyone is interested:
{series}/{author_sort:'test(ifempty(field('series'),""),"", $)'}/{series_index:0>2s|| - }{title} - {authors}
The heart of what I was trying to do is this:
{author_sort:'test(ifempty(field('series'),""),"", $)'}
Here's the logic (I did not find relational operators, otherwise it might have been simpler):
So, if {series} is empty, calibre won't create {series} folder in the first instance. After that, if series is empty, the function
ifempty(field('series'),"")
will return an empty string. This string will be thrown at the test function it is called within:
test(FUNCTION,"",$)
If the value of the function is "" (that is if, and only if, the {series} field is empty, the function test will output the value of the author field, $; if the value is not empty, then test will return an empty value.
Therefore, when {series} has a value the whole template will be:
series_name/""/book_title (and calibre will convert it to series_name/book_title)
When {series} has not a value the template will be:
""/author_name/book_title (and calibre, I expect, will convert it to author_name/book_title)
If anyone has experience in coding, please correct or confirm... thank you!!!
Rus