According to the IRS in publication 970, "As shown in the following list, to be qualified, some of the expenses must be required by the institution and some must be incurred by students who are enrolled at least half-time" This would imply - but not outright state - that some of the expenses do NOT have to be incurred while enrolled. Indeed, the language of the first example would indicate exactly this:
Only the third example explicitly states that those expenses need to be incurred while the student is enrolled. So, as long as the expenses are incurred in the same year as the withdrawal, I think the $400 could be considered part of "Tuition and Fees," and constitute a qualified withdrawal. If it were me, though, I would probably consult my tax professional before pulling the money out.
It'd be even better if the IRS gave more explicit guidance, though!