You can't use cap space and then use your mid level, you have to pick one or the other.
You can , as long as you don't go above the tax apron. We did that with Jason Terry a few years ago. There is usually a misinterpretation between the MLE and cap space. The MLE is related to paying the luxury tax, not on going over the salary cap.
From Larry Coon's NBA Salary Cap FAQ
"NON-TAXPAYER MID-LEVEL EXCEPTION -- This exception is available only when a team is below the "apron" (i.e., not paying luxury tax, or less than $4 million above the tax line). This determination is made after the exception is used, so a team below the apron cannot use this exception if doing so takes it above the apron. It cannot be used by a team that has already used the Taxpayer Mid-Level Exception or the Room Mid-Level exception."