First, before you write any code you need to really understand how LoRaWAN networks work.
It’s not really clear why you want to run custom code on the gateway at all.
More typically, you would point the gateway at a LoRaWAN network server running in the cloud (eg, TTN, a hosted instance of Chirpstack, and instance of Chirpstack you set up, etc…)
Your custom data-consuming code would also be running in the cloud (or temporarily on your development PC) and interacting with the server in the cloud. Note that even if you use TTN as the server, you can still get the resulting data to your own cloud consumer by a variety of means.
Building code to run on OpenWRT is possible but painful. As a result, it doesn’t make sense to do so unless it is really necessary that the code run on the gateway and not elsewhere - which is really not how LoRaWAN is designed to work. LoRaWAN is designed to use the collective view of nodes acheived by uplinks reported in from multiple gateways, something that can really only be leveraged when the code that handles the network runs in the cloud and not an individual gateway.
So in a “real” LoRaWAN network, the only reason for code to run on a gateway is if that code has the purpose of managing or implementing the gateway functionality; any “network” or “data” code should be running elsewhere.
Even if you were going to build a small, isolated network somewhere off in a remote part of the world with no connection to anything else, you’d probably find things worked better if you added your own embedded computer to host the data-related tasks. Once you are very sure what you want, then porting python code (with limited dependencies) or C code to the gateway itself is technically possible, but it’s not a good place to start a learning project.
Another way of putting it: What exactly did you do on the previous pi? What sort of radio was involved (what is a “RoLa comm module”???) and how did you get data from it? The RAK7258 uses an ordinary SPI-interfaced LoRaWAN concentrator card, using what is basically the ordinary code for running that, but it’s not clear at all that your previous setup did.