Ok this is what I think you might need to do
use the SPRITE COLLISION command to detect what sprite your character is colliding with.
SpriteTouching=SPRITE COLLISION(CharacterSprite,0)
Once you have the number of the sprite you are touching then you get the sprites angle. To do this you need to make sure you are holding each sprites angle to begin with.
eg. Sprite1Angle=90
(However a User defined type would be better for this if you know how to use them)
Then you need to rotate your character to that angle
ROTATE SPRITE CharacterSprite, (The Angle the sprite is touching)
Simplified:
.Make sure you store each sprites angle
.If character is touching a sprite find its angle
.Change your characters angle to the sprite touching it
I can think of several problems you might encounter by doing it this way, like the object touching two sprites at once etc. But best to just try to get that working first.
Edit: or better yet use the SPRITE ANGLE command instead of storing your angles,