Because it's cheap, the first bit of engine maintenance I'll do whenever I buy a used vehicle is replace any and all vacuum lines. While they may appear to look good, the rubber gets soft, and can callapse, or there can be small cracks that are unseen.
I'd attack the fuel/air mixture. Look at the large intake tube that runs from the air filter box to the throttle body. Inspect it carefully for cracks. Check ALL the lines that connect into the intake; these are where unmetered air can enter the intake and cause that rough idle you mention. Check the injectors themselves. A clogged injector will cause a lean mixture. Search here for ways to test the injectors. RonD has written up some great "how to's" on this subject.