Option B is a REALLY bad programming style. It is slow, as you found out. It prevents MATLAB from optimizing your code for efficiency.
In general, learn to avoid scripts. Put the heavy lifting work into functions, although sometimes a mainline script to combine everything together is not a bad thing. What you have here in B is the worst of worlds.
As you learn to write functions, making your code modular, you will be able to reuse code for a variety of problems. That gains on programming time, for your NEXT project. It helps you to debug your code, because you work on one small function at a time. Get each part correct, then worry about the next part.
Is option B better for readability? Why would it be so? Sorry, but not true. Learn to write and use functions. Your code will be better for it, especially as you start to write MODULAR code.