It's been a while. I don't remember the steps exactly, but I think I've managed to do it.
I had to create an "ap0" network interface by creating the 70-persistent-net.rules file (the process is described in the previous link I've sent). wlan0 is used to access wifi, and ap0 will be used to provide an access point. When the ap0 interface is created, the wlan0 is deactivated, so at some point I had to call "ifconfig wlan0 up" or something similar. I've heard that the order in which the interfaces are turned up matters, so you might have to try turning the ap0 on before (or after) the wlan0. At this point I think you should be able to see both interfaces when you use the command ifconfig.
Then I had to tweak the wifi.sh script because it was trying to use the ap0 interface to connect to wifi. I hardcoded it to use the wlan0.
Now that both ap0 and wlan0 interfaces exist, I followed the tutorials at RPI official docs:
https://www.raspberrypi.com/documentation/computers/configuration.html#setting-up-a-routed-wireless-access-pointJust keep in mind that tc uses a different path for the hostapd and dhcpcd configuration files: /usr/local/etc (if I'm not mistaken). Because I don't want any kind of bridging, I skipped the section "Enable Routing and IP Masquerading".
After a few more tweaks (which I unfortunately don't remember right now), I finally got both access point and wifi working at the same time. The channel used by the access point must be the same channel used by the wifi, so first you have to check the channel that your wifi network is using and then configure the hostapd file accordingly.