@raceraidan Let's just focus on the engine at the moment as I am confused as to what you have. If I don't know the engine, then we're going to be chasing a rabbit down a hole here.
If the engine came from a Gilera originally, then it is not an '89 engine.
It'll be a DTRE motor that was found in Yamaha's later production run.
The reason why this is important is because the flywheel on the last revision of engines is inverted. The cranks are different to compensate for this and then so are the stators. Besides the removal of the kickstarter (which can easily be retrofitted) they are identical crankcases/engines. It's only the aforementioned changes.
Secondly, I am not as familiar with the Gilera side of things, I know the engines are similar to the later DTRE, however the ignition is different.
A few years ago I couldn't get my DTR running right (turned out to be a Chinese ignition coild, swapped it for genuine and all problems went away) and when trying to diagnose an issue, I tried to source an OEM DTRE CDI, as I run Zeeltronic ignition system and have had the misfortune of having a faulty one in the past.
RE ignitions have all but dried up (I never should have sold mine) and the only thing I could get my hands on was a Gilera ignition.
Because the engine's are the same, I thought it was worth a punt, but alas I couldn't even get the engine started with the Gilera ignition and as such we need to understand your engine.
You fitting a random engine into a random frame is not going to help us identify the problem. So we need to understand the parts you have in order to diagnose.
There used to be guru's in field like @scrimsmustang who could tell you the engine year from the engine number, unfortunately I don't know how to resolve that, but I can tell you a lot about the engine from some exterior photo shots and whip the generator cover off and get some pics and I'll tell you some more.
Let's go from there and work our way out.
Also yes, with regards to the side stand switch, these can be a royal pain in the bum. Years ago my brother had a 2001 DTR and something was wrong with the sidestand switch and looping it out wasn't sufficient, I can't remember if he grounded the wire, but whatever it was, you legit couldn't start the engine with the key in the 'On' position, you had to kick it over and switch the ignition from off to on to get it to fire up.
So I am weary about the side stand switch.
The oil light I am not worried about as as far as I know, it doesn't loop back into the CDI, but a Haynes wiring diagram will confirm this. If I go into my workshop at some point I will have a look for you.