This will not be possible as a confined app.
You will need a background service that listen to incoming sms and forward it.
I'm not sure if such app can be allowed in the openstore, but here is a few things to know.
First create your background service, it could be in standard python if you are familiar with.
Ofono is the service that emit notifications when new incoming sms, it uses dbus.
api can be found here:
https://github.com/rilmodem/ofono/blob/master/doc/messagemanager-api.txt (old repository but sending and receiving sms still like that )
AI can help you with a minimal script.
then when your service seems to work, you have to create all the plumbery to install/remove/run it, you can find an example with battery-saver app: https://gitlab.com/lduboeuf/battery-saver/

