How can I scale an overlay within an ffmpeg filtercomplex?

My approach would be two separate commands, one to calculate the dimensions and another to overlay. You can simply use FFprobe which comes alongside with FFmpeg. To calculate the dimensions you can use the following command.

ffprobe -v error -show_entries stream=width,height -of default=noprint_wrappers=1 input_video

This will result like following.

width=1280

height=720

After you can do what ever the math you want and apply this to your overlay command. Also here are some more options for scaling.

Hope this helps!