How do I get the index number of currently displayed slide of a Views Slideshow into the jQuery Cycle's "Before" advanced option?
Looking at the JS code for views_slideshow_cycle:

case "before":
  var beforeValue = advancedOptions[option];

  beforeValue = Drupal.viewsSlideshowCycle.advancedOptionCleanup(beforeValue);
// transition callback (scope set to element to be shown):         
function(currSlideElement, nextSlideElement, options, forwardFlag)
  settings.opts[option] = function(currSlideElement, nextSlideElement, options, forwardFlag) {
    pager_before_fn(currSlideElement, nextSlideElement, options);
      eval(beforeValue);
  }
  break;


Your code isn't actually executed within the scope of the before callback, it's executed afterwards. The variable that the module provides is named options rather than opts, hopefully that will resolve to what you need and the change should be as simple as:

alert(options.nextSlide + " of " + options.slideCount);