I'd imagine tinfoil would give off some sort of vapour when heated which probably wouldn't be all the best for you. Maybe you just inhaled to much and it gave you some weird headache type thing.

Probably best just to steer clear of tin foil in the furture.