Oh yeah, it wouldn't work would it? Private messages don't have ops :p
Anyway, I think you need to define more narrowly what you're trying to accomplish. The code you've provided is functional assuming that /respond exists - but maybe it isn't behaving how you expect it to. What do you mean by "doesn't return the echo"?
With the code you've provided !test will trigger the first event, not the second (because it has already triggered on the first and both share ^). Anything not beginning with ! will trigger the second.
on ^*:text:!*:?:haltdef
on *:text:!test:?:echo -ag $nick said !test
on *:text:!com:?:echo -ag $nick said !com
on *:text:!*:?:echo -ag $nick said any other command
Here all !commands are hidden but can still be processed when the other events fire.