I want to run a command, for example
echo \"foobar\";
After each command, entered by the user.
Two scenarios:
As l0b0 suggests, you can use PROMPT_COMMAND to do your second request and you won't have to touch PS1.
PROMPT_COMMAND
PS1
To do your first request, you can trap the DEBUG pseudo-signal:
trap
DEBUG
trap 'echo "foobar"' DEBUG