Brother I recommend a overhaul hardly a 35,000 job with genuine parts. 240,000 not a big deal for diesel of Toyota 2C.
Engine swap will reduce car value and is costly too.
2NZ FE 1.3L engine came in both local xli GLi and still comes in 2015 Corolla so easiest to maintain. It also comes in JDM X Assista Corolla bolt on swap no major modifications required and cheapest to buy with auto approx 50k. Less weight on front so best balanced car. 2 variants vvti & non vvti. Lowdown is that since u r driving 2.0L diesel M/T u feel short of torque with this one.
2nd comes 1.4L 4ZZ-FE & 1ND-TV D4D Diesel both very rear & expensive don't go for them.
3rd comes 1.5L 1NZ-FE as suggested by fellow PW member very good engine came in imported G Corolla and Axio.
4th comes 1.6L 3ZZ-FE both local & imported available came in Se Saloon & US Models
5th is 1.8L 1ZZ-FE which came in local Altis from 2005 to 2011.
Most expensive are 1ZR-FE & 2ZR-FE which are in current Altis.
My suggestion go for 1ZR-FE if u can afford it's best may cost u around 150k with transmission in exchange of ur diesel or settle for any of the ZZ series engines with good condition & compression.
Last option should be 1NZ-FE. However it's good for 90% of the tasks u throw at it and is economical and cheap too.