Is it possible to write a smart contract that can execute solidity code send to it as data?
Yes and no.
The Solidity compiler isn't available inside the EVM, so there's no way to compile new source code at runtime.
That said, you can compile the Solidity code in advance and pass the compiled byte code to a contract. The contract can't then directly execute that code, but it can deploy it as a new contract and interact with it that way (including using
DELEGATECALL to run it in the context of the original contract).
Without knowing your scenario better, it's hard to give more specific advice.
In theory you can write an interpreter of solidity and run it inside the EVM.
In practice this is complex because the EVM has some restrictions like block gas limit, or transaction size, this limits how large your contract can be. You can use libraries to leverage contracts size but that will increase the complexity and maintenance of the project.
Also writing a very large project in solidity is a daunting task. There's no specialized IDE for large projects, you have solidity plugins for popular IDEs but they are very simple, there's no refactoring feature.
No that is not possible. Solidity is a static typed language so the logic can only be defined once (before you deploy for the first time).