Take a warm bath, drink warm milk if you have milk to heat up, and go buy some sleep -aide over the counter medication or some benadryl cold medicine. It will help counter act the stimulant you took. Take only the recommended dose of the Tylenol PM, drink some warm milk, and get in a nice tub filled with very warm water with the lights turned low. Take deep calming breaths. Meditate on getting your heart to calm down. If you still feel bad after 10 hours or so, go to the ER. The stimulant you took may have put your heart into a beating or rhythm pattern it can not get out of on it's own.
You can have a panic attack that lasts as long as the effects of the medication taken to treat it as panic attacks can last from a few moments to 30 or more minutes. Due to this variation, it is essential that you only take medication that has been prescribed by a doctor.
Do you have access to a benzodiazepine like Xanax, Valium, Ativan or Klonipin? You may need a dose to break the cycle. But be careful - they can be very addictive and the withdrawal can be a nightmare. Use sparingly.