You may wanna check the
history of SMBX. (I'm not sure if this is the best we've got, but it'll have to do for now)
About SMBX's source code: I'm pretty sure redigit, the creator of the original SMBX, doesn't care at all about this game anymore and nobody knows if he even has the source code anymore. Not only that, but the progress made on SMBX2 is so large that having the source code would be mostly an impediment, since anything made on SMBX2 would have to be recreated again on the original source code.
About recreating the engine: apparently it's not so easy. It's true that recreating the basics of Mario, such as jumping and running may be easy, but we're talking about recreating the entire SMBX engine, and as the link i posted mentions, there have been attempts on it (for example, NSMBX, which was abandoned around two years later after its conception). The only two attempts which are still not abandoned today are the PGE engine, which is very far from completion and the general advice is to stay away from it, and a SMBX clone called "SMBX 38A", which...
just see it for yourself. Note that this one is also closed source.
Basically, the reason things are like this now is because recreating the engine would've taken a lot more work than just hacking it and I don't think anyone really wants to try and recreate it now. I don't really know if things will ever change; perhaps one day the PGE engine will be perfect and everyone will switch to that, but that's a long time from now.
(All that said, I'm not a SMBX2 dev myself, but I do check the development from time to time and all of this is mostly what I've heard.)