I did this:
-copy FieldTest.app from var/stash/Applications of 3.1.2 to var/stash/Applications of iOS4
-copy fieldtest.plist, fieldtest68.plist and specialkeys.plist from System/Library/PrivateFrameworks/CoreTelephony.framwork/Support of 3.1.2 to System/Library/Frameworks/CoreTelephony.framwork/Support of iOS4

*3001#12345#* Call now shows the FieldTest pages.

I put an icon.png into Fieldtest.app and delete the last key of its info.plist to make FieldTest icon shown on the screen.

Tested on 3GS, iOS4.0 , JB, Ultrasn0w 0.93