Is it possible for a Macbook Pro to pop out a window and / or give some sound a few minutes before sleeping?
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.