I have tried to look in the documentation but can't find how I specify my monitors vertical size so GroovyMame can get correct aspect ratio.
It doesn't work like that in GM. GM attempts to reproduce the output of a PCB, assuming that aspect correction is done by the user (the arcade operator).
In the crt_range definition, there's a value named "progressive lines min". By default, it's set to 192 for arcade presets. The meaning of this value is the minimum number of lines that the user is willing to tolerate as correct aspect (4:3), that is to say, the user will adjust the monitor's v-size pot to fit the screen. Below this value, GM will calculate a new "high" 4:3 resolution and use fractional stretching.
The only way you can add artificial borders is lying GM about your monitor's real aspect ratio. E.g., if you use the option -aspect 16:9, GM will try to correct aspect ratio by adding borders on each side, even if that means picking a wider resolution which provides those borders naturally. Unfortunately you'd need different aspect ratio values for different heights and there's no way to do that.
The other possible approach, that would allow different border sizes per height, is to divide your crt_range into several subranges per height (224-240, 240-248, etc.), then use different horizontal porch value for each range, producing different border sizes. This will work fine, but the catch is you won't be able to use the borders for artwork or anything because they're "hardware" borders (blanking).
So as you see there are solutions following GM's logic, but they're not simple because GM not designed with that in mind.