You say you inherited the house and then sold it. I assume you received the proceeds of the sale & it is that money which you want to put into a trust.
I do not think a deed of variation of a Will or an Intestacy can be done retrospectively. If I am right (& you could check this with the solicitor who dealt with the probate) it is too late for you to do a deed of variation to put the money into a trust. However, there are other ways of putting money into a trust but you would need legal advice as the subject is complex. Also the cost of setting up a trust can be considerable.
Whether you can use the deed of variation route or not, it is very likely that DWP will treat putting the money into a trust as deprivation of capital. They will also treat as deprivation use of it in “spending sprees”. From that point of view, it could help you (as I think you realise) if the money was in a discretionary trust and the trustees released it to you in small regular amounts so that you could (when the funds are nearly used up) demonstrate to DWP that it has been used responsibly on your reasonable living costs. If you reach that situation they should then restore your ESA, if you still qualify for it on other grounds.
You need advice from an experienced Welfare Benefits Adviser ro see whether there is any basis on which DWP might be persuaded to restore your ESA earlier. Free services are available from your local Citizens Advice Bureau and, in some areas, the local authority.