if(isequal([Track#],99,5),[Track#], - if track# is greater than 99, then use[track#]
if(isequal([CUETrack],source,8), - if [track#] is less than or equal to 99, does [cuetrack] contain source?
if(isempty([Disc#],1),100,[Disc#]00), - if [track#] <= 99 and [cuetrack] contains source, is [disc#] empty? if so, use 100, else use [disc#]00 <-- you sure? we've just established that [disc#] is empty?
if(isempty([Disc#],1), - if [cuetrack] does not contain source, is [disc#] empty?
if(isempty([Track#],1),[Track#], - if [cuetrack] does not contain source, and [disc#] & [track#] are both empty, then use [track#] <--again, you sure?
if(isequal([Track#],10,3),0[Track#],[Track#])), - if [cuetrack] does not contain source, [disc#] is empty, and [track#] is less than 10, use a preceding zero, otherwise, just use [track#]
if(isequal([Disc#],1,6), - if [cuetrack] does not contain source, and [disc#] is not empty, is [disc#] greater than or equal to 1?
if(isequal([Track#],10,3),[Disc#]0[Track#],[Disc #][Track #]),) - if [disc#] is greater than or equal to 1, is [track#] less than 10? if so use [disc#]0[track#], otherwise, use [disc #][track #] <-- this is the 1st time you've used the standard MC fields? This at the end, ",)" says, if [disc#] is less than 1, then do nothing.
))) - closes the branches: if(isempty([Disc#],1), ; if(isequal([CUETrack],source,8), ; if(isequal([Track#],99,5),[Track#],
-------------------------------------------
It looks OK on paper, though some of the statements don't feel quite right, for example, you ask if the [disc#] is empty, and if it is not empty, you ask if its value is greater than or equal to 1, which it must be, otherwise, it would be empty.
I can't test it because of the custom fields etc. but, when building these things, I find the order in which you ask the questions can help greatly.
I try to imagine a main line from start to end, if the answer is yes, then I leave the main line and follow this branch to it's conclusion, and having dealt with that scenario, go back to the main line and ask the next question, "if it's not that, is it this then?"
It can also help if you break long complex expressions into little bits. If each of the little bits work, but the whole doesn't, it just means you put it together wrong. Use temporary stoppers if you need them to make the snippets work:
if(isequal([Track#],99,5),[Track#],if(isequal([CUETrack],source,8),source,no source))
kind of thing.
Finally, how are you putting the expression to use? as a custom library field?
-marko.