I think:
simfun <- function(n=100,lambda=1,P=1,ret.df=TRUE) {
X <- rbinom(n,prob=1/3,size=1)
E <- rexp(n,1)
EL <- rexp(n,lambda)
Y <- ifelse(X==0,E,
ifelse(E<=P,E,P+E*EL))
## return data frame or matrix
if (ret.df) data.frame(X,Y) else cbind(X,Y)
}
system.time(res <- replicate(1e4,simfun(),simplify=FALSE))
## 6 seconds
## or:
library(plyr)
system.time(res2 <- raply(1e4,simfun(ret.df=FALSE),.progress="text")
## returns a 1e4 x 100 x 2 array, maybe more convenient: use
## rlply instead of raply (and ret.df=TRUE) to match the previous
## results