There's usually a keypad factory reset mode. Usually it's something like power-off the phone, power it back on while holding "end call". It's different per handset, but on my wife's Nokia it was something like, with the phone off, "hold power, end-call and # for 10 seconds".
Alternatively, you could see if it's possible to upgrade the firmware. Firmware upgrades often wipe the phones (because the nonvolatile memory space gets totally changed around).
Edit: here you go:
http://ars.samsung.com/customer/usa...D=557&PROD_SUB_ID=558&PROD_ID=751&AT_ID=76205
(found with Google "factory reset keypad")
I hope this clears the code for you... and doesn't just delete all your data. But usually a factory reset clears a user lock code.