That said, there are a few fanfictions I've seen published on a small scale. Not legal but if it's a small scale project, sometimes Hasbro doesn't care.
I'm going to have to agree with that, unfortunately. Equestria Daily often runs ads for a website that sells physical copies of fanfictions with not just official, but G4 characters which I would expect they'd lock down even harder than the old stuff, and they don't seem to have any repercussions for it. That said, I'd be the last to fault you for wanting to be cautious. I'd probably change the characters myself if I were in that position.
As for how, if you do eventually decide to look into it again, unfortunately I don't have any experience with it myself but I do know that there are lots of self-publishing options out there, services that can help you put your story into a book. I'm sure it's just a matter of finding one you like and trust, and who's terms your agree with.