TeenHealthFX is very concerned about you. You ABSOLUTELY need to stop doing this. IT IS NOT SAFE!
It sounds like you already know that what your doing is unsafe, unhealthy, and could possibly cause serious damage. From what you describe, you are probably changing the normal rhythm and balance of oxygen and carbon dioxide, and altering your blood pressure. The headache is probably due to the sudden rush of blood back into your head. This is not healthy, and you should not continue this practice. You should see a physician to determine if you have already caused neurological or cardiovascular damage. If you live in northern NJ, call the Adolescent/Young Adult Center for Health at (973) 971-6475.
FX is curious as to why you are doing this. Is it a cool party trick you discovered? A way to escape? Do you like the feeling? If it is a way to escape or you like the feeling, you need to get help from a therapist to discuss why you are trying to escape or what is causing you to want to alter your normal state (the reasons behind the behavior). Making yourself pass out is not normal and is serious, so please seek out both medical and emotional help. In northern NJ, call the Access Center for Behavioral Health at (888) 247-1400.