No, you can use it in "normal" programming as well.
I would advise against it though: it is "any session, any scope" = which means it may or may not relate to anything you have done, but could be a different user action entirely. Use @@IDENTITY instead if you can.
There is a non-SP example on MS here:
http://technet.microsoft.com/en-us/library/aa933217(v=sql.80).aspx[
^]