Some comments on your script:
Instead of redirecting syntax errors to [tt]/dev/null[/tt], do something about them.
In your case, I imagine the errors you were getting came when $1 and $2 were blank. Thus, surround them with quotes (like in my example). Then, when the arguments are blank, your condition correctly returns false instead of having a syntax error that you need to hide.
Your test for [tt][ -d "$2" ][/tt] is well-intentioned, but it takes some of the functionality away from cd.
For example, I commonly use [tt]cd[/tt] without arguments to return to my home directory, and [tt]cd -[/tt] to go back to the last directory I was in. Those would get rejected under your script.
It also makes it impossible to use command line options (like [tt]-P[/tt]) with the mistyped command.
Instead, you should just pass all the arguments to [tt]cd[/tt] as they were typed and let [tt]cd[/tt] decide whether they're valid or not, and then it can give appropriate errors if they aren't.
Finally, make your command do something reasonable when it decides not to cd. Otherwise, I can keept typing "c" over and over again and not get any indication that what I'm doing isn't working.
My example tries to run the [tt]c[/tt] command (the [tt]command[/tt] builtin causes it to ignore functions named [tt]c[/tt], thus avoiding a recursive loop). This way, if there is a [tt]c[/tt] command, I can still run it through your function. If not, then Bash will complain about not being able to find a [tt]c[/tt] command.
Letting Bash do the complaining keeps you from having to attempt to emulate Bash's error messages in order to keep consistent.
Also, a correction to my examples: replace
with
and
with
This allows you to pass arguments to the hypothetical [tt]c[/tt] and [tt]l[/tt] commands if they end up being run.