I looked into developing something with this function long ago. Something similar to the NoLED app designed for the Nexus series Android phones.
As I recall a non-jailbroken phone will not allow applications the access to the messaging app (or notifications in general) to allow this. Even if it did allow access, no app can access the display on a locked phone to provide the visual feedback necessary to make the app useful.
From experience, the functionality of an app of this nature is negated by the power draw of the display. The battery life hit on a Nexus S 4G was noticeable.