first the bulb, you should replace it. a flickering HID bulb means it's going bad and has reached the end of its life. the D2R bulbs on my IS300 did the same thing, and after removal, i found cracks on the glass of the bulb! the ballasts hardly ever go bad unless shorted or shocked.
as for the leveling system that's a separate issue. check the connections first before changing the motor. it could just be loose. does the other headlight leveling system work fine?