Yes, you can write code in a separate file and then import it to cartridge with tic-80 console commands[1]
You don't have to do this manually every time, just make a shell script with multiple commands; e.g. this will import code, save and run the cartridge:
./tic80 --skip --fs="$PWD" --cmd="load cart.tic & import code main.lua & save & run
The other way is indeed to buy or build yourself a PRO version, it can work with cartridges in plaintext format.
You don't have to do this manually every time, just make a shell script with multiple commands; e.g. this will import code, save and run the cartridge:
The other way is indeed to buy or build yourself a PRO version, it can work with cartridges in plaintext format.[1] https://github.com/nesbox/TIC-80/wiki/import