The best work around at the moment appears to be disabling errors before attempting to create the directory:
option batch continue mkdir /my/remote/dir option batch abort cd /my/remote/dir put ./myfile.txt
But this can also cause the script to continue in other error cases, such as a failure due to not having permissions. Another option is to switch to writing code in a separate language interface, but that's an incredibly heavy handed solution for such a simple and common need.
It would be better if mkdir supported continuing when the directory exists out of the box. Something like this, for example:
mkdir -skipifexists /my/remote/dir cd /my/remote/dir put ./myfile.txt
(The option name could be something different, of course.)
Here are some threads referencing this need: