Well it's like this.
If your problem on the Mac didn't affect the software or the TimeMachine backup, then restoring from that using SetupAssistant (when you first set up a new Mac it will ask you to restore) should go fine.
HOWEVER, if there are software issues on the Mac that also transferred to the TimeMachine drive, that will only transfer them back onto your new computer.
You can't very easily just pick out the things you want to restore from TimeMachine with, it doesn't give that fine detail of control, and if it's really messed up, it might not restore anything at all.
The golden rule of backups is to maintain two separate and easily accessible hardware copies of your data off the machine at all times.
Since you don't know for sure if the TimeMachine restore is going to work as intended, and your only other source is going to disappear, I'd advise a additional backup of your Music, Documents, Pictures and Movie folders etc., to another regular external drive via regular drag and drop copy methods.
The operating system and programs can all be reinstalled from fresh sources on the new machine, provided you have the AppleID and password, license codes for your programs, email passwords and any other necessary information to re-establish the license on the new machine.
(In some cases licensed software HAS NOT transferred to a new machine with a TimeMachine restore and had to be reinstalled)
Some times you have to contact the developer or "uninstall" the licensed program so it sends a signal to their servers that the program has been removed, else your license code may not work on the new machine.
You might decide the new machine would be better off with a fresh install of your programs that you know are 100% compatible with Lion etc., leaving a lot of older stuff you installed over the years off the new machine, if you restore from TimeMachine, you don't have this option. You pretty much get all the crap along for the ride,
If your new machine gets all crapped up, then restoring Lion is going to going to be a tough challenge, as you need a strong reliable Internet connection to download a fresh copy of Lion from Apple servers (no more disks). Once you do that, then somehow you have to use third party software ($$) to cherry pick your files out of TimeMachines trap. More headaches than you anticpated, and likely a charge by a specialist.
So I'd advise another hard drive with a copy of just your files, just in case a crap-up occurs
You can restore Lion yourself if it craps up, install programs from fresh sources as you know how to do, use the old license codes and then return your files manually exactly back into their same Music, Pictures, Documents, and Movies (etc, not Library) folders as before.
The key to this manual method is to make sure to use the same user name as before, so all your file location data pathnames retained by program files like iTunes to where the songs are located on the drive, are matched. Once you open these programs and restablish the links in OS X, then you can move them around.
Some tricks, if you use iPhoto, you can right click "show package contents" and inside is a folder with your Originals, copy that out and you can reimport your pictures into the new iPhoto Library on the new machine.
So use TM if you dare, but prepared to do things manually is my opinion.
TM restores have not been all that reliable or dependable, the more messed up your machine is, the worst the restore seems to be.