Should I restore my data before or after upgrading the OS?
It won't matter as far as the software goes since Lion runs the migration script one time only on your Snow Leopard data whether you migrate it in from a backup or it's there when you do the upgrade to Lion.

From a human standpoint, I would encourage you to make a "test" account (pick a different short name to prevent conflict or confusion when migrating your "real" account later) 

Updating and testing Lion lets you build confidence the Lion is working on your repaired hardware.


Run Snow Leopard updates to 10.6.6 at least to get the App Store if needed
Install Lion
Run all updates
Test Lion in the test user. Once you're happy it works, migrate in your user data.


There's no right or wrong here - so do whatever makes the most sense to you. You've had a rough spell with the first upgrade / hardware failure - no need to over complicate things unless you really feel more steps is better.