RoboScript: Code Generation for Free-Form Manipulation Tasks across Real and Simulation