The LG GT540 root is interesting in that it's very similar but not the same as the LG GW620 root, detailed here on XDA developers. For the GT540, LG introduced an additional level of security in the engineering application. It didn't really work out so well.
To enable Superuser access (root) on your GT540:
- Turn on the device and click the icon to open the phone dialler
- Enter the code '3845#*540#'
- Select the option 'Module Test', then 'Stability Test' then 'Enable Root Permission'
- You will now be prompted for a password - enter :SWIFT::GT540:
- A toast message will briefly appear saying 'OK' - your root access is now enabled!
- Reboot your device, and now when you connect via ADB, you'll see you have a root prompt (#).
You can now download and install ChainsDD's excellent Superuser app from here (I used the su-2.1-cd-unsecure version).
Job done! Enjoy!