You should just wire the halos to the parking light, not the sidemarker since it wig-wags at night. The parking lamp wire is the brown one (the one you want), and the blue is the turn signal (the one you don't want).
Since you say you have halos I assume you have a 97-03 Grand Prix? Anyway, it sounds like the ballasts are losing power and shutting down when the car is shut off. When you shut off the car's engine the voltage will naturally drop slightly, though it still shouldn't drop enought to shut off the ballasts. This leads me to believe the HID's are not connected to a relay harness which means you will eventually fry them. This is all speculation as your description of the problem is kind of vague. Can you take pictures of the headlights and the HID ballasts? It would help.