The text message would constitute evidence of his agreement.
Just make sure you preserve it. Perhaps photograph the phone with the message on the screen.
Chances are that you will have to sue him in small claims court.
Read the PA landlord tenant statute for the security deposit rules:
http://www.thelpa.com/PA_landlord_tenant_act.pdf
At the moment, though, you would be wise to just not pay for the final month and let him apply the security deposit if he wants to. Then, if he takes any legal action you can address that when it happens.

