This looks like a variant of this question:
https://superuser.com/questions/175799/does-bash-have-a-hook-that-is-run-before-executing-a-command
A bash function that run prior to execution might be able to detect the extra space and then log the command or take another action.