Is it possible for a Macbook Pro to pop out a window and / or give some sound a few minutes before sleeping? Is there a way to pop out a window and / or to give out some sound a few minutes before it goes to sleep?
There is one warning, but I hope to get another warning a few or a couple of few minutes before it would go to sleep.
Sleeping involves writing all data to the hard drive and reloading all data afterwards, and also any external SSD drive would report not being ejected properly.
One way I can think of is to run a script either continuously or as a cronjob, and every 3 minutes, use some Unix command to get the battery level, and when it is 3% or lower, give out audio bell for 30 seconds.
The free option is to use a Launch Agent in the ~/Library/LaunchAgents which uses launchd to run your script on a set interval and when the condition is met, take the desired action. I'd give it a try and see how it works for you. Otherwise...
A paid option is:
There's a product called Power Manager which has a Run a scrip on battery remaining event, although the lowest you can set the script to trigger is 5%. Has a fully functional free 30 day trial. Its  license costs from 12.95 USD for 12 months.
(A bit steep if you as me, and I don't like yearly licensing schemes!)
Note: I am not affiliated with the developer of this product.