I need a script for an address field for purchase orders and Invoices

I did find this post from awhile back that I believe should do what I want it to do, but unfortunately, I could not get it to work. If anyone would not mind a brief walkthrough, I would be super grateful.