If you go for the Linux/Raspberry option, the coding will be of similar difficulty (perhaps a fraction easier). But Linux / RaspberryPiOS puts you on the never-ending upgrade and security path. There's not much in the way of attach surface on an ESP, but a Pi needs more thought. Especially as (over time) the little Pi is likely to acquire more complex apps ... a web front-end would be tempting :) ... but then you have to upgrade a webserver, and keep all the libraries up-to-date...
Keep it simple.