I agree...get a tax accountant to help with this one.
With that caveat, the IRS is very specific about what is considered a deductible educational expense. As I recall, if you get education to qualify you for a new position, then you are not allowed to deduct the cost. On the other hand, if you are a CFI-ASEL and you add your CFI-MEL, then you are just training to improve you abilities as a flight instructor. In that case, it would be deductible.
If you are a commuter pilot and you pay for a 737 type rating, but your airline doesn't fly 737's, then you have an education expense to qualify you for a new job - and it's not deductible. (I would argue that it is a job-search expense since SWA requires a rating for the interview.) Again, see a professional.
I ran into this some time ago with my rotorcraft rating. At the time, that was the ruling.
Cheers,
AKAAB