In order to braille the example you give, I would first assume that those green boxes (shaped a little like an address plaque) represent calculator keys. I would also assume that the blue 'r' in your example is blue simply for emphasis. You should check these assumptions by looking at the rest of your book.
Then, I would address the blue 'r' issue in a TN explaining that variables which are printed blue are italicized in braille. And I would include a note on the Transcriber's Notes page giving a tactile representation of the calculator key shape shown in print.
Then, I would braille your example as shown below (with the second and third lines indented appropriately -- starting in CELL 3):
[simbraille],s4,a4 .k #4.p.;r^2
.k #4.p ,,ans $kx^2"]$kenter]
Please check that those green boxes are indeed calculator keys, that the 'r' is blue only for emphasis, and that your text does not use italic for any variables (so you can use it to represent blued variables).
edited by kdejute on 7/28/2015