I had issues with the sunroof on two of my Stilos. Plain and simply, they're badly made; they're weak and prone to breaking. It will have broken a cable guide or cable somewhere inside the roof and the horrible clicking noise will be because the motor is jumping and can't move the roof, that's also the reason why it tries to open on one side.
The reason why the blind isn't working is because the motor ECU thinks that the roof is open, so it won't let you close the blind. To quickly fix and close it, you'll need to unscrew the main motor from the roof, but leave the wires connected, then perform the reset mentioned above. Then the roof will think that it's closed & the blind will work again.
It'll have nothing to do with jacking the car up or having the boot open, it'll just be a coincidence that it's happened at the same time.
It'll need the sunroof replacing to repair it. If you're mechanically minded, then you might be able to repair it, but you WILL need to to remove it from the car first to dismantle it. From what I remember, they're not too hard to remove, they're more fiddly and heavy than difficult. I just replaced the entire sunroof in both instances when I had issues. If you remove the roof lining first, then you'll probably be able to see what the issue is. It'll be on the side that's not moving.
All the sunroofs are the same in all Stilo models, although finding a good used one now might be difficult. I did read once that the same roof was used in a Mercedes too, but I don't recall what model or what year.
Hope that helps.