#1 sounds almost exactly like my last employer, while #2 could be one of several places I interviewed or had friends work at. I won't give you advice - there's no conceivable way I could know enough about your situation - but I'll give you some additional questions to ask:

For #1:

1.) How many customers do they have? An enterprise software company hasn't achieved "product-market fit" until customers come to them. Since enterprise sales often run $100K+, it's possible to be profitable without actually having a viable product: you simply agree to customize the product until it exactly fits the potential customer's needs. A company like this is effectively a consulting company, not a product company, though.

2.) How easy is it for a customer to stop using the product, and if possible, who are the customers? When I interviewed, I heard "We're profitable" and "Our software is a critical part of our customer's infrastructure." But I completely missed that "We sell to hedge funds" means "Our customers can blow up and disappear totally", because I had no idea how the financial industry worked. Then I read an article in BusinessWeek that named one of our customers as potentially impacted by the subprime collapse. (FWIW, none of their customers has blown up yet. But it was enough to make me nervous...)

3.) Does "a steep learning curve to understand their system" mean that they have an intricate platform that nobody understands? This will slow you down, particularly if they haven't attained product-market fit, and probably cause you a lot of frustration. Also, home-grown systems are not transferable knowledge; it's worthless to a future employer.

For #2:

1.) How good are their technical skills? Some founders are lax because they're great hackers and don't have time to spend on mundane formal procedures. Some founders are lax because they're just sloppy. In my experience, the latter are far more common. However, if you can work with the former, it'll probably be one of the most rewarding experiences of your life.

2.) Are they a product company or a consulting company, and are they planning to become a product company in the future? I don't know anyone who has been happy working for someone else's consulting company: basically, you can expect them to take 50-90% of your billable wages, give you very little support, and make you put up with their bullshit. However, you do get to see a lot of other people's problems, and it's a decent jumping-off point for later jobs.

For both:

1.) How focused are each of them? In my experience, the best predictor of success is focus. When I interviewed at a #1-like company, I heard "We have 4 products, so we don't need to score a home run or go bust. We can make a succession of base hits and grow the company incrementally." It sounded logical to me. After contributing 2 years and 2 products (out of their now 7, only 2 of which have paying customers), I'm not so convinced. Problem is, all those dead projects imposed requirements upon the core platform, which made it much more complicated than if it only supported one product. Complexity slows you down, and a startup really doesn't have resources to promote 7 products anyway.

Really, if I have any advice, it'd be to learn as much as you can about both companies and where the founders are planning to go with them, and then sleep on it. Go with your gut. You have more information than anyone here.

But understand that you'll probably be wrong. In my case, I went for #1 instead of an unprofitable VC-funded #2. In the intervening 2 years, the profitable enterprise startup is basically where it was when I joined (well, except that its existing customers like it better, it has 3 new products - only one of which has paying customers, and its technology platform is even more complicated). The unprofitable startup (where I played Foozball against the CEO during my interview) has since attained profitability on its one product, and has added a second product that's been doing very well.

BTW, I think people tend to overestimate the amount of knowledge they'll gain from hacking on enterprise software. Much of it is incredibly poorly written, and much of the rest isn't much more complex than what you'll learn from reading through the LiveJournal source code. Enterprise software is complex because every customer has these arcane little quirks in their requirements, and then the product accumulates all these little special cases for all its cuomers. This isn't the type of complexity that expands your mind, though: it's death by thousand papercuts.

If you want mind-expanding complexity, read SICP, learn Haskell, buy Building Scalable Web Sites by Cal Henderson and read through the LiveJournal source code, learn JQuery and read through the source code, and pick a fast open-source webserver like Lighttpd or Nginx and read through its source code.