Too hard to read, take care of exceptions first.
Handle each case in it's own if, then you can have more complex conditions.
This is one of the few times, this many separate returns in a method would be acceptable
private bool CanExecuteAdd(string parameter)
{
if (this.Script == null)
return false;
if (parameter.NotIn([] {"Step", "Element", "Choice", "Jump", "Conditional jump"})
throw new Exception("Unknown Add parameter {0} in XAML.".F(parameter));
if (parameter == "Step")
return true;
if (parameter == "Element")
this.ElementSelectedInLibrary != null && this.SelectedStep != null;
// etc, etc
}
Oh, and the .NotIn is an extension method, the opposite of this, I would imagine (can't say this is quite exact to what is needed)
public static bool In<T>(this T obj, IEnumerable<T> arr)
{
return arr.Contains(obj);
}