Your y# doesn't change, try this:
sync on
sync rate 30
make object cube 10,100
yr#= object angle y(10)
do
if upkey()=1 then move object 10,2
if downkey()=1 then move object 10,-2
if leftkey()=1
yr#=wrapvalue(yr#-5)
yrotate object 10,yr#
endif
if rightkey()=1
yr#=wrapvalue(yr#+5)
yrotate object 10,yr#
endif
sync
loop
Or this, which is tidier but harder to read:
sync on
sync rate 30
make object cube 10,100
do
move object 10,(2*upkey())-(2*downkey())
yrotate object 10,wrapvalue(object angle y(10)-(5*leftkey())+(5*rightkey()))
sync
loop
cheers, Tom