No idea how to do that using Python within AutoCAD, but you can do this in reportlab and save the pdf.
You have to write the text and the box to something and save it.
#https://docs.reportlab.com/reportlab/userguide/ch11_graphics/
from reportlab.graphics import shapes, renderPDF
from reportlab.graphics.charts.textlabels import Label
from reportlab.graphics.shapes import Drawing
from reportlab.lib import colors
from reportlab.lib.pagesizes import A4
mypdf = 'reportlab/pdfs/rotate_text_in_rectangles.pdf'
width, height = A4
d = Drawing(width, height)
# mark the origin of the label
d.add(shapes.Circle(200,500, 7, fillColor=colors.green))
label = Label()
# define the properties of label
# change 1 property, repeat d.add(label) and renderPDF.drawToFile(d, mypdf, 'What\'s this?') to see the modification
label.setOrigin(200,500)
lab.boxAnchor = 'ne'
label.angle = 45
label.dx = 0
label.dy = -20
label.boxStrokeColor = colors.pink
label.boxStrokeWidth = 4
label.setText('ABCdeFGh\nIJK\nLmnO')
label.fontName = "Helvetica-Bold"
label.fontSize = 20
label.width = 110
label.height = 70
d.add(label)
# this saves d as a pdf
renderPDF.drawToFile(d, mypdf, 'What\'s this?')