Now that Quickscript has hooks (see here), it should be fairly easy to format as you wish:
From this script, just replace the line that removes trailing spaces with
(define new-str (program-format str))
This requires Racket ≥v8.10.3 (which is in the snapshot for now). Let me know if that works — or not!