a lot of the devs & contributors are hobbyists. I am a mechanical engineer with no formal training in development or programming. In fact XDA was built mostly by hobbyists, hackers & regular folks that wanted something different & were willing to learn. I can garuntee you there are more hobbyist Android hackers building ROMs the formally trained professional developers. Android provides everything you need to learn & build upon the aosp source, not too mention the availibilty of reference code used for gui's & hooks for apps like Maps.+Dugzino Ramani
parts of the user side code are NOT open source. If you spent the time & money developing a software feature, you would not want to make it easy for your competitors to steal your work either. Just like if you want special features in many of the custom ROMs, you have to "donate" for an app to unlock & activate certain features. I agree that Samsung should at least be providing a source that will at least build, but I don't blame them at all for protecting the millions they invest in features like their Wacom powered S-Pen, the various camera modules & multi-window/multi-view. Especially when you have desperate manufacturers like HTC looking for any way to get back into the game.
As for the S4, Qualcomm has never been great at releasing all the source & engineering guides for their latest & greatest. I have the One X with the S4 and my Note 2, Note 10.1 & Nexus 10 with Exynos all have more development going on. Personally, I am partial to Nvidia, but regardless of the processor, if the device is popular & sells, it will be developed for, definitely with numerous unofficial builds & most likely official as well. If you want to ensure development on a device you purchase, go international. Although Samsung firmware now is getting much easier to port & support between versions, like the 7100, 7105 & i317 for instance. Their firmwares are just short of being interchangeable the way the ship. That hardware standardization helps big time.