I think you want $IsNull rather than if, in your example. $If requires specific criteria, like $If(<Sort Album Artist> = "Beatles, The",,)
Try this:
$IsNull(<Sort Album Artist>,<Sort Artist>,<Sort Album Artist>)\$IsNull(<Year>,,<Year>" ")<Sort Album>\<Disk-Track#> <Title>
Also, bear in mind that <Sort Album Artist> probably defaults to <Sort Artist> if there's no Album Artist value, so the first part may be redundant. I suggest trying different things in the File Organization window and seeing what the preview looks like.