Wasn't it TM who said script execution actually increases near the end of a script? I have never tested it tho. Organizing your code by execution order does make a difference in speed critial situations but for general use it's not such a huge deal. Something to think about is seperating speed critical from non speed critical code also. Like scanning for buff bar icons, you probly only need to do that every half second to a second, so that could be put on a timer. But checking for health needs to be instantaneous, so you keep that in the main loop on a tight leash. Also, minimizing your use of waits is huge. If your script needs to heal, but isn't doing anything AFTER that heal for 2 seconds, there's no need to put a wait there... Soft waits...

You put the wait inside the top of the script, and check the soft wait timer so you only have to wait the leftover amount of time from the wait. This allows you to do things based on variable timers also. So one thing requires a wait 20, but something else requires only a wait 5, if it's a variable timer, the flow of the script is nearly perfect. Example:
Note: Doing it this way will also allow you to skip things based on that same time if you'd like too. So say if you wanted to cast a heal above all else, in your sub whatever, you'd have if %softWait > #sysTime && #hits < #maxhits - 20 then return... so it would skip the whatever sub because your health was low, and go on to the next sub which would be heal, and would have nothing there to make it skip the heal. So you can work script flow with tons of set conditions too, that work with your timers.
sub whatever
if %sofWait > #sysTime
return
set #lobjectid #findid
event macro 17
set %softWait #sysTime + 2000
return
sub nextsub
if %hits < #maxhits - 20
{
REPEAT
UNTIL %SOFTWAIT < #SYSTIME
DO HEAL HERE
SET %SOFTWAIT #SYSTIME + 2000
}
return