>>in the next bar, the condition checking for the pending order will be done before the body of the script, or after?

Before. Limit checking follows the same behavior as TMFs.