Hi theskintman,
I think you're seeing the effects of an asynchronous call here, the variable is not being set to "success" before the line returning a value executes!
You can force jQuery's ajax call to run synchronously by setting the property "async" to false. This may not be the best way to work with your code - it may be that your success callback could act more directly on your page or data and you would be better considering that... in any case the following may give results more inline with your intentions: