How to flash screen from command line
As far as I know, you can't replicate this alert without enabling that option. If you do enable that option, you can cause a flash from Terminal using:

osascript -e "beep"


However, if you don't want to enable that option, you can use invert colours. Using the invert colours Accessibility option twice causes the screen to flash, therefore pressing the keyboard shortcut ⌃⌥⌘8 twice will cause a flash:

#!/usr/bin/osascript
tell application "System Events" to repeat 2 times
key code 28 using {command down, control down, option down}
delay 0
end repeat