cool way to make a rounded rect!
there are already a roundedRect example in the repository: see https://github.com/typemytype/drawbot/blob/master/examples/roundedRect.py
I would encourage you to make a python package out of your helper tools that you import when you needed it...
# a separate file with the name "roundedRect.py"
# draw your stuff here
# an other file in the same directory
# name of the file/module name of the function
from roundedRect import roundedRect
# call it
hope this makes sense!