You can test run the script as a whole when it is ready, but it's also good to soak-test different parts of the script.
For example, create a new script (or modify your current one) to repeat a certain action perhaps 100 times (e.g withdraw required items from the bank, deposit all, repeat). This is a good way to test the rigidity of parts of the functionality of your script in a short time frame (thus hopefully reducing the likelihood of a ban).
Also, it's important to test exceptional flows / edge cases. For example, what happens if you start your script in castle wars, or if you die while the script is running, or if your bank is full and you need to deposit something, or if the script misclicks on a ladder and ends up upstairs in a building, or ... (the list goes on). Naturally it is not possible to cover all cases as the possibilities for anomalies are pretty much endless with any script, but you can weigh the possibility of an edge case happening and decide to implement a solution accordingly.
Apa