My usual solution for this is to specify the margin character at the end of the last line of the proof to be the end-of-proof square in the following way:
.mc \(sq 0 \" Specify the square to be placed directly after the end of the current line.
.mc \" Restore the setting to the previous.
You might want to place this in a end-of-proof macro, depending on your troff template.