I had the same issue on my 04 OBW LTD. I pulled the headliner and the entire sunroof assembly from the car. Parts for the front lift scissor assembly were stripped from the 2 geared whips that run down each side of the sunroof assembly, and run both front and rear sunroofs. This was back in 2006, the parts were $150 (?) or so back then.
I replaced the front sunroof lift assembly on the bench, put the entire assembly in its closed position (both roofs), and reinstalled it back into the car.
Be aware that the front sunroof glass comes entirely off the car first, and goes back on last, after the rest of the sunroof system is fixed and installed. Get a factory service manual, and it becomes a time consumming job, but not a difficult one. I'm a DIYer who's maybe more experienced than most, but a long way from being a mechanic.
Look on this forum and on the USMB forum (Ultimate Subaru Message Board) under my name and you'll find several posts where I've given a step by step on the disassembly procedure. Good Luck!