Will closing a MacBook cancel restoration from Time Machine backup?
It will put the MacBook to sleep, which effectively pauses the restore.

Since you're restoring from external media even if the MacBook itself doesn't recover nicely when woken back up you could simply start another restore from the same Time Machine drive.