hi, first you should find the instument cluster next to the trip reset, then hold down till blinks then press buttons. It's done. hope your clock of bmw z4 is fine now
There is no easy solution for this. You are going to have to take the car back to BMW service or the BMW specialist you used to replace the original motor for testing and analysis..
Don't keep trying to drop the roof down as you may not get it back up again if you do lower it and you will be in worse trouble.
If the lights are switched then the switch controls a rely all lights are switched on bmw. Can use fog lights temporarily. Find rely test with continuity meter when on, disconnect lights first, then turn on lights switch, check for 12v at light bulb terms, if 12v then bulbs bad, if not relay is bad, test with continuity meter, rely should read 0 ohms when lights switched on, infinite open circuit when switched off. If lights work in manual switch pos then solar sensor bad.