A stake will keep it in a more upright and when more of it turns woody with age, it should stay in that position - but by the time that happens, the new growth above will be as weak and floppy. Blowing a fan on it can help prevent leaning, especially in combination with periodically rotating halfway, but the effectiveness on an already leaning plant may or may not be enough.
Trimming some leaves from the low side can help remove some of the weight. Trimming some of the height would also remove some of the weight and might help alleviate some of the lean. Impossible to gauge that before trimming is done. Once it gets taller than the top of the window, the top won't be able to get enough light.