We don't allow users to post other peoples code for three main reasons: (Described here)
Moral / Polite
Would you take the criticism upon yourself, and not blame the original authors? It's plain rude to post something and shrug off criticism to another person. We are not Code Crap.
I can't answer this on your behalf, so if you think you'd do this, you should probably refrain from posting your question.
Practical
Can you tell us why you used A over B, if we were to question your code? And if we changed the code do you know the original code well enough that our changes would improve your abilities?
As you asked "would I be better off writing a new script from scratch and then asking for feedback on that", I would say you can cut the middle man here and just say yes to both of these.
Legal
The original code is MIT and so, IANAL, I think there is no concern here.
And so if you're ok with the moral/polite implications, then I'd say it's on-topic. But if not, write a new script and it'd definitely not be off-topic for this reason.